user2630385
user2630385

Reputation: 11

HighCharts showing date range average 18:00-19:59

I have a chart that renders out a point and a legend for each timestamp received from a webservice. My problem is that when you zoom out the chart takes an average of a number of points and creates one point and legend which appears to show an average of that time range.

This is what the legend currently reads:
Monday, Jul 8, 18:00-19-59

but we need it to read and render these points separately like this:
Monday, Jul 8, 18:00
Monday, Jul 8, 19:00
Monday, Jul 8, 20:00

I have looked extensively over the high stocks documentation and forums but can't see where this configuration is set. I have tried the range selector and x axis but no luck. I'm assuming this is a setting that defaults to true which we just need to set to false.

Any help would be appreciated.

Chart function below:

            $(setasid).highcharts('StockChart', {
                chart: {
                    renderTo: $('.charthold', top),
                    plotBackgroundImage: backgroundImage,
                    events: {
                        load: loader(top)
                    },
                    width: 714,
                    height: 459
                },
                scrollbar: {
                    enabled: false
                },
                rangeSelector: {
                    enabled: false
                },
                title: {
                    text: chartTitle,
                    style: {
                        color: blue,
                        fontWeight: 'bold'
                    }
                },
                loading: {
                    style: {
                        backgroundColor: 'silver'
                    },
                    labelStyle: {
                        color: 'white'
                    }
                },
                exporting: {
                    enabled: false
                },
                labels: {
                    style: {
                        color: blue
                    }
                },
                yAxis: {
                    title: {
                        text: Pricein + currencyunit + '/' + units,
                        style: {
                            color: blue,
                            fontWeight: 'normal'
                        }
                    },

                    plotLines: [{
                        value: ndata.spotPrice,
                        color: red,
                        width: 2,
                        label: {
                            text: Currentspotprice + ndata.spotPrice.toFixed(2),
                            x: 40,
                            style: {
                                color: blue,
                                zIndex: 50
                            }
                        }
                    }]
                },
                xAxis: {
                    ordinal: false

                },
                plotOptions: {
                    series: {
                        color: blue,
                        marker: {
                            enabled: true,
                            radius: 0,
                            fillColor:  '#97833c',
                            lineWidth: 0,
                            lineColor: null, // inherit from series

                            states: {
                                hover: {
                                    enabled: false
                                }
                            }
                        }
                    }
                },

                series: [{
                    name: SpotvaleLable,
                    data: ndata.data,
                    color: blue,
                    shadow: true,
                    tooltip: {
                        valueDecimals: 2
                    },
                    event:
                    {
                        update: function() { loader() }
                    }
                }]
            });

Upvotes: 0

Views: 571

Answers (1)

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

You need to disable datagrouping http://api.highcharts.com/highstock#plotOptions.series.dataGrouping

Upvotes: 1

Related Questions