0

I have a specific query.

Following is my script for highcharts. When I run this sript, I get a memory leak issue. Maybe someone can help. I need to show the x-axis in exponential scale, like

100,000
1,000,000
10,000,000

and so on.

var chart = new Highcharts.Chart({
            chart: {
                renderTo: 'dvCon'
            },
            title: {
                text: 'Construction: Duration vs Productive Hours'
            },
            xAxis: [{
                type: 'logarithmic',
                title: {
                    text: 'Construction Hours'
                }
            }],
            yAxis: [{
                labels: {
                    formatter: function () {
                        return this.value;
                    },
                    style: {}
                },
                showEmpty: true,
                title: {
                    text: 'Duration',
                    style: {}
                }
            }, ],
            tooltip: {
                formatter: function () {
                    return '' + this.x + ': ' + this.y;
                }
            },
            legend: {
                layout: 'horizontal',
                align: 'center',
                verticalAlign: 'bottom',
                backgroundColor: '#FFFFFF'
            },
            series: [{
                name: 'Other Projects',
                type: 'scatter',
                data: [[560000, 13], [185250, 11], [3625788, 23], [1648510, 21], [265000, 14], [13000000, 43], [28000000, 34], [1567000, 19], [1190000, 20], [21000000, 31], [7000000, 33], [3805200, 30], [17000000, 29], [1503267, 21], [11332332, 29], [1485067, 20], [5000000, 30], [5400000, 22], [13000000, 23], [3810000, 26], [810000, 18], [27528218, 26], [377319, 14], [840000, 22], [550000, 13], [2643142, 26], [412800, 13], [2500000, 22], [4510000, 19], [523116, 15], [17600000, 28], [2500000, 21], [21000000, 29], [3500000, 17], [620000, 15], [163000000, 46], [134000000, 41], [45000000, 39], [13677454, 31], [167000000, 52], [47000000, 33], [49000000, 38], [31000000, 38]]
            },
            {
                name: 'User Data',
                type: 'scatter',
                data: [[40050000, 35]]
            }]
        });
user15
  • 1,044
  • 10
  • 20
Jeena
  • 33
  • 1
  • 6

1 Answers1

1

The code works fine, except the additional , after the yAxis object.

jsFiddle > http://jsfiddle.net/SSCEk/

Maybe the issue happens with a particular version of highcharts, jquery or a browser?

Jugal Thakkar
  • 13,432
  • 4
  • 61
  • 79
  • Thank you Jugal. I was using an older version of jQuery & Highcharts. But after adding the versions that you included in the jsFiddle, I have another problem. My x-axis shows does not show as 100,000 1,000,000 so on. It now shows as 200k,400k,600k and so on. It works on jsFiddle but not on notepad. Can u help pls? – Jeena Feb 18 '13 at 06:20
  • http://stackoverflow.com/questions/14378181/replacing-removing-the-metric-notations-like-thousands-k-abbreviation/14378820#14378820 should help you – Jugal Thakkar Feb 18 '13 at 07:07
  • Soory Jugal, I think I was not clear earlier. I want the x-axis to start from 100,000, then 1,000,000, then 10,000,000, then 100,000,000 and so on. I don't want it to start from any other number. Can u pls try the same script on a notepad as HTML rather than jsfiddle. Then you will see what I mean. Thanks again. – Jeena Feb 18 '13 at 07:13
  • You can use tickPositioner / tickPositons parameters: http://api.highcharts.com/highstock#yAxis.tickPositioner and http://api.highcharts.com/highstock#yAxis.tickPositions – Sebastian Bochan Feb 18 '13 at 09:56
  • @Jeena ya, you can explicitly give the positions like Sebastian mentioned – Jugal Thakkar Feb 18 '13 at 15:14