jQWidgets Forums

jQuery UI Widgets Forums Chart chart decimal places

This topic contains 2 replies, has 2 voices, and was last updated by  atomic 11 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • chart decimal places #49963

    atomic
    Participant

    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!!!

    chart decimal places #50046

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    chart decimal places #50056

    atomic
    Participant

    Thank you Dimitar!
    I downloaded new version of jQWidgets (3.2.1). and now it works!
    Thanks again!
    Best

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.