jQWidgets Forums
jQuery UI Widgets › Forums › Chart › chart decimal places
Tagged: chart, decimalPlaces, formatSettings, jqxChart
This topic contains 2 replies, has 2 voices, and was last updated by atomic 11 years, 2 months ago.
-
Authorchart decimal places Posts
-
Hi,
I would like to remove decimal places in my jqx chart (y asis). So I used formatSetting in SeriesGroups, everything works except when I put 0, it still shows two decimal places, when I put 5, for example, it works properly, showing 5 decimal places…seriesGroups: [ { type: 'stackedcolumn', columnsGapPercent: 100, seriesGapPercent: 5, valueAxis: { unitInterval: 0, minValue: 0, maxValue: 'auto', displayValueAxis: true, description: unit, axisSize: 'auto', tickMarksColor: '#888888', formatSettings: {decimalPlaces: 0}, }, series: series_fuels
Thanks!!!
Hello atomic,
We tested for the reported issue, but everything works fine at our side. Please make sure you are using the latest version of jQWidgets (3.2.1). Here is the working example, based on the demo Logarithmic Axis Base 10:
<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxchart.js"></script> <script type="text/javascript"> $(document).ready(function () { var sampleData = [{ a: 0.35, b: 14.5 }, { a: 1, b: 2.5 }, { a: 10, b: 0.2 }, { a: 100, b: 205 }, { a: 1, b: 100 }, { a: 5.11, b: 10.13 }, { a: 20.13, b: 10.13 }, { a: 600, b: 300}]; var settings = { title: "Logarithmic Scale Axis Example", description: "Sample logarithmic scale axis with base 10 and baseline at 1", padding: { left: 5, top: 5, right: 5, bottom: 5 }, titlePadding: { left: 0, top: 0, right: 0, bottom: 10 }, source: sampleData, enableAnimations: true, categoryAxis: { dataField: '', description: '', showGridLines: true, showTickMarks: true }, seriesGroups: [ { type: 'column', valueAxis: { description: 'Value', logarithmicScale: true, logarithmicScaleBase: 10, baselineValue: 1, unitInterval: 1, tickMarksInterval: 1, gridLinesInterval: 1, formatSettings: { decimalPlaces: 0 }, horizontalTextAlignment: 'right' }, series: [ { dataField: 'a', displayText: 'A' }, { dataField: 'b', displayText: 'B' } ] } ] }; $('#chartContainer').jqxChart(settings); }); </script> </head> <body style="background: white;"> <div id='chartContainer' style="width: 680px; height: 400px;" /> </body> </html>
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thank you Dimitar!
I downloaded new version of jQWidgets (3.2.1). and now it works!
Thanks again!
Best -
AuthorPosts
You must be logged in to reply to this topic.