jQuery UI Widgets › Forums › Chart › Not able to track the dot on chart
This topic contains 2 replies, has 2 voices, and was last updated by sushanth009 12 years, 7 months ago.
-
Author
-
Hello Peter,
I am using the jQuery chart plugin and it seems to be working fine. I have enabled the animations in the definition. But I am not able to track the current value where the mouse points in the chart. When I check the console section for errors I see this error which comes up.
Uncaught TypeError: Object # has no method ‘indexOf’
Can you suggest what can be done to tackle this problem.
Thanks
SushanthHello Sushanth,
Not Peter this time round.
Can you please provide us with a code sample so we can better be able to help you?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello Dimitar,
The json object used for this method is
var result = [ { "Cos":"5163.81", "Mon":"9/2011" }, { "Cos":"3854.58", "Mon":"10/2011" }, { "Cos":"3794.45", "Mon":"11/2011" }, { "Cos":"3892.87", "Mon":"12/2011" }, { "Cos":"3759.38", "Mon":"1/2012" }, { "Cos":"3842.94", "Mon":"2/2012" }, { "Cos":"3462.44", "Mon":"3/2012" }, { "Cos":"3564.41", "Mon":"4/2012" }, { "Cos":"3593.97", "Mon":"5/2012" }, { "Cos":"4752.73", "Mon":"6/2012" }, { "Cos":"4484.10", "Mon":"7/2012" }, { "Cos":"4984.44", "Mon":"8/2012" }]
And the Code that is used to populate the Graph is..
drawCharts = function(result) { try { var source = { datafields: [{ name: 'Mon' }, { name: 'Cos' }, { name: 'Usg'}], localdata: result, datatype: 'array' }; var cMaxValue = 0; var cMinValue = 0; var uMinValue = 0 for (var i = 0; i < result.length; i++) { if (parseFloat(result[i].Cos) > cMaxValue) { cMaxValue = parseFloat(result[i].Cos); } if (parseFloat(result[i].Cos) < cMinValue) { cMinValue = parseFloat(result[i].Cos); } } if (cMaxValue != 0) { cGraphInterval = Math.round((cMaxValue + 1) / 10); } else { cGraphInterval = 1000; } $('#cost').jqxChart(chartSettings(source, 'Cost', 'Cos', cGraphInterval, cMinValue, cMaxValue)); } catch (e) { alert('drawCharts !! ' + e); }};chartSettings = function(source, txt, dtField, graphInterval, minValue, maxValue) { var dataAdapter = new $.jqx.dataAdapter(source); var settings = {}; settings = { title: txt + " - Last 12 months", showLegend: true, source: dataAdapter, enableAnimations: true, padding: { left: 30, top: 20, right: 15, bottom: 30 }, titlePadding: { left: 30, top: 0, right: 0, bottom: 10 }, categoryAxis: { text: 'Category Axis', dataField: 'Mon', showGridLines: true, textRotationAngle: -87, axisSize: 'auto', textInsideIntervals: true }, colorScheme: 'scheme01', seriesGroups: [ { type: 'line', valueAxis: { unitInterval: graphInterval, minValue: minValue, maxValue: maxValue + 1, displayValueAxis: true, description: txt }, series: [ { dataField: dtField, displayText: txt } ] } ] }; return settings;}
The graph is being populated but not able to track with the mouse
-
AuthorPosts
You must be logged in to reply to this topic.