Home
> Discussions & Support
> Topic
using decimal values in bar chart?
Posted by kingmoore
using decimal values in bar chart? June 30, 2009 02:32PM |
Registered: 14 years ago Posts: 3 |
Hello,
I have got my bar chart rocking thanks to JSCharts, however I can't seem to send decimal values to set data array. Is there a trick to doing this? I can send whole numbers just fine, but when I send decimals it tells me:
JSChart: Input data in wrong format for selected chart type
JSChart: No data loaded
However this seems strange because I can get the graph to display decimals using:
myChart.setBarValuesDecimals(1);
It is just aways .0 because I can't send my own decimal values.
I have got my bar chart rocking thanks to JSCharts, however I can't seem to send decimal values to set data array. Is there a trick to doing this? I can send whole numbers just fine, but when I send decimals it tells me:
JSChart: Input data in wrong format for selected chart type
JSChart: No data loaded
However this seems strange because I can get the graph to display decimals using:
myChart.setBarValuesDecimals(1);
It is just aways .0 because I can't send my own decimal values.
Re: using decimal values in bar chart? July 02, 2009 01:22PM |
Registered: 15 years ago Posts: 117 |
Can you show some code please? At least the data array.
Sabin
--------------------
JS Charts - Created by Smartketer LLC
Sabin
--------------------
JS Charts - Created by Smartketer LLC
Re: using decimal values in bar chart? July 07, 2009 02:42PM |
Registered: 14 years ago Posts: 3 |
yeah, code is like this:
[/code]
ode]
[/code]
<div id="fantasy_graph"> <script type="text/javascript"> var myData = new Array(['W1',17.1],['W2',18.2],['W3',8.0],['W4',22.0],['W5',4.9],['W6',11.9],['W7',25.0],['W8',0.0],['W9',20.3],['W10',29.8],['W11',8.6],['W12',14.4],['W13',19.2],['W14',12.2],['W15',17.2],['W16',9.0],['W17',16.5]); var myChart = new JSChart('fantasy_graph', 'bar'); myChart.setAxisColor('#fff'); myChart.setAxisName''); myChart.setAxisNameY('') ; myChart.setAxisValuesColor('#000'); myChart.setAxisValuesFontSize(10); myChart.setBarBorderColor('#300'); myChart.setBarBorderWidth(2); myChart.setBarSpacingRatio(35); myChart.setBarValuesDecimals(0); myChart.setBarValuesColor('#000'); myChart.setBarColor('#600'); myChart.setSize(700, 200); myChart.setTitle(''); myChart.setTitleColor('#600'); myChart.setGrid(false); myChart.setAxisPaddingLeft(0); myChart.setAxisPaddingRight(0); myChart.setAxisPaddingTop(10); myChart.setAxisPaddingBottom(20); myChart.setShowYValues(false); myChart.setDataArray(myData); myChart.draw(); </script> </div>
[/code]
ode]
[/code]
Re: using decimal values in bar chart? July 08, 2009 05:38AM |
Registered: 15 years ago Posts: 117 |
Odd, I don't get any alert. I commented the myChart.setBarValuesDecimals(0) line and the decimals were shown normally. Does it happen in any browser? What OS/browser/version are you using?
Sabin
--------------------
JS Charts - Created by Smartketer LLC
Sabin
--------------------
JS Charts - Created by Smartketer LLC
Sorry, you do not have permission to post/reply in this forum.