I have a highcharts line graph that shows sales data. Is there a way to sum up the data for a selected period of time? For example, if I plot daily sales reports, to be able to highlight and sum up one week of that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you’re describing is not a native feature of highcharts. You can get a series from the chart object and perform the calculations you want on it individually, or have the tooltips or legends display the sum over the whole series. But it’s not natively possible to highlight only part of a series and they provide no convenience methods for what you’re describing.
If you’re satisfied with summing over a whole series, I would use the legendFormatter hook and show the series sum as part of the legend. If it needs to be a subset of the series you’ll need to write it yourself, possibly using the hover event for series to start the event.