Skip to content

Commit

Permalink
Graph fixes for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
colinphanna committed Nov 30, 2012
1 parent df9de33 commit adcc5b6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 49 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/dashboard/script_manager.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ext.ns("Talho");
dominoes.rule('RowActions', '(( $css($(css)/redesign/Ext.ux.grid.RowActions.css) )) $(ext_extensions)/Ext.ux.grid.RowActions.js');
dominoes.rule('TreeGrid', '(( $css($(css)/TreeGrid/css/TreeGrid.css) $css($(css)/TreeGrid/css/TreeGridLevels.css) )) $(ext_extensions)/TreeGrid/TreeGrid.js > $(ext_extensions)/TreeGrid/Overrides.js');
dominoes.rule('AudiencePanel', 'TreeGrid <%= javascript_dominoes_paths("audience/AudiencePanel") %>');
dominoes.rule('AudienceDisplayPanel', '<%= javascript_dominoes_paths("audience/AudienceDisplayPanel") %>');
dominoes.rule('AudienceDisplayPanel', '<%= javascript_dominoes_paths("audience/AudienceDisplayPanel") %>' );
dominoes.rule('NewInvitation', '(( $css($(css)/ux/fileuploadfield/fileuploadfield.css) $css($(css)/ux/RowEditor.css) )) $(ext_extensions)/FileUploadField.js $(ext_extensions)/RowEditor.js $(js)/invitations/NewInvitationBase.js');
dominoes.rule('ProfileBase', '(( $css($(css)/redesign/profile.css) )) $(js)/profile/ProfileBase.js');
dominoes.rule('BatchUsers', '(( $css($(css)/ux/fileuploadfield/fileuploadfield.css) $css($(css)/ux/RowEditor.css) )) $(ext_extensions)/FileUploadField.js $(ext_extensions)/RowEditor.js $(js)/ext/src/widgets/grid/EditorGrid.js');
Expand Down Expand Up @@ -48,7 +48,7 @@ Ext.ns("Talho");
'Talho.Dashboard.CMS.Admin': {js: 'AudiencePanel <%= javascript_dominoes_paths("dashboard/cms/admin_controller") %>'},
'Talho.Admin.Organizations': {js: 'AudiencePanel <%= javascript_dominoes_paths("admin/organizations/Controller") %>'},
'Talho.Admin.OrganizationMembershipRequests': {js: '<%= javascript_dominoes_paths("admin/organization_membership_requests/Controller") %>'},
'Talho.Admin.Apps': {js: '$css($(css)/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.css) $css($(css)/ux/fileuploadfield/fileuploadfield.css) <%= javascript_dominoes_paths("admin/apps/Controller") %>' },
'Talho.Admin.Apps': {js: '$css($(css)/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.css) $css($(css)/ux/fileuploadfield/fileuploadfield.css) <%= javascript_dominoes_paths("admin/apps/Controller") %>'},
'Talho.Dashboard.Apps': {js: '<%= javascript_dominoes_paths("dashboard/apps/Controller") %> '}
};

Expand Down
43 changes: 13 additions & 30 deletions app/assets/javascripts/ext_extensions/FlashGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,12 @@ Talho.ux.FlashGraph = Ext.extend(Ext.Container, {

initComponent: function () {

// var store = new Ext.data.JsonStore({
// fields:['name', 'visits', 'views'],
// data: [
// {name:'Jul 07', visits: 245000, views: 3000000},
// {name:'Aug 07', visits: 240000, views: 3500000},
// {name:'Sep 07', visits: 355000, views: 4000000},
// {name:'Oct 07', visits: 375000, views: 4200000},
// {name:'Nov 07', visits: 490000, views: 4500000},
// {name:'Dec 07', visits: 495000, views: 5800000},
// {name:'Jan 08', visits: 520000, views: 6000000},
// {name:'Feb 08', visits: 620000, views: 7500000}
// ]
// });
//
//
// this.items = {
// xtype: 'linechart',
// store: store,
// xField: 'name',
// yField: 'visits',
//
// };


this.store.each(function (record) {
var test = record;
});

this.items = [
{xtype: 'columnchart', store: this.store, xField: 'report_date',
{xtype: 'linechart', store: this.store, xField: 'report_date',
url: 'ext3-3-charts.swf',
chartStyle: {
padding: 10, animationEnabled: true,
Expand All @@ -57,17 +36,21 @@ Talho.ux.FlashGraph = Ext.extend(Ext.Container, {
},
yAxis: new Ext.chart.NumericAxis({
displayName: 'Absent',
labelRenderer : Ext.util.Format.numberRenderer('0,0')
labelRenderer: Ext.util.Format.numberRenderer('0,0')
}),
xAxis: new Ext.chart.TimeAxis({
displayName: 'Date',
labelRenderer: Ext.util.Format.dateRenderer('M-d')
}),
tipRenderer : function(chart, record, index, series){
var tip_string = Ext.util.Format.number(record.data.total, '0,0') + ' students absent on ' + record.data.report_date;
tip_string += '\n\r'+Ext.util.Format.number(record.data.enrolled, '0,0') + ' students enrolled on ' + record.data.report_date;
tipRenderer: function(chart, record, index, series){
var tip_string = Ext.util.Format.number(record.data.total, '0,0') + ' students absent on ' + record.data.report_date.format('M-d-Y');
tip_string += '\n\r'+Ext.util.Format.number(record.data.enrolled, '0,0') + ' students enrolled on ' + record.data.report_date.format('M-d-Y');
return tip_string;
},
series: this.series
}
];

Talho.ux.FlashGraph.superclass.initComponent.apply(this, arguments);
Talho.ux.FlashGraph.superclass.initComponent.call(this);
}
});
19 changes: 3 additions & 16 deletions app/assets/javascripts/ext_extensions/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,16 @@
Talho.ux.Graph = Ext.extend(Ext.Container, {
layout: 'fit',
cls: 'ux-graph-container',

// constructor: function(){
// var cls;
// if(Talho.Detection.SVG){
// cls = Talho.ux.D3Graph;
// }
// else{
// cls = Talho.ux.FlashGraph;
// }
// Ext.apply(this, cls.prototype);
// cls.constructor.apply(this, arguments);
// }
//

initComponent: function () {
if (Talho.Detection.SVG) {
//this.items = [new Talho.ux.FlashGraph({store: this.store, height: this.height, series: this.series})];
if (Talho.Detection.SVG()) {
this.items = [new Talho.ux.D3Graph({store: this.store, series: this.series, xField: this.xField, yLabel: this.yLabel, xLabel: this.xLabel,
yMin: this.yMin, yMax: this.yMax, xDisplayName: this.xDisplayName, showLegend: this.showLegend})];
}
else {
this.items = [new Talho.ux.FlashGraph({store: this.store, height: this.height, series: this.series})];
}

Talho.ux.Graph.superclass.initComponent.apply(this, arguments);
Talho.ux.Graph.superclass.initComponent.call(this);
}
});
3 changes: 2 additions & 1 deletion app/views/layouts/non_application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<%- if protect_against_forgery? -%>
<meta name="authenticity-token" id="authenticity-token" content="<%= form_authenticity_token %>" />
<%- end -%>
<title><%= current_app.title.blank? ? current_app.name.titleize : current_app.title %>: <%= controller.controller_name %>/<%= controller.action_name %></title>
<title><%# current_app.title.blank? ? current_app.name.titleize : current_app.title %>: <%= controller.controller_name %>/<%= controller.action_name %>
</title>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
Expand Down
Binary file added public/charts.swf
Binary file not shown.

0 comments on commit adcc5b6

Please sign in to comment.