httpete
Posts: 11
Joined: Tue Feb 13, 2018 3:13 pm

Beginning of Time / Epoch Indicator?

Hi,

We have a system that collects events, and those events start at a date, say March 1, 2018. Does highcharts have the notion of an epoch, so the chart can shade out with an indicator such that the users can see that there is no data before this date? Ideally I'd like a configuration that I can set globally throughout the app that all charts show this special shaded pre-history area.

sort of

[ ////no data !///// March 1, 2018 ]

?
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Beginning of Time / Epoch Indicator?

Hi, httpete!

It is hard for me to imagine that. Could you tell me, what type of chart do you want to use? How do you want it to look like? It would be great if you could send me a jsFiddle with a simplified chart that I could work and present you configuration you are looking for on. Or maybe you could send me a picture of how the chart should look like?

Kind regards!
Rafal Sebestjanski,
Highcharts Team Lead
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Beginning of Time / Epoch Indicator?

Hi, httpete!

It can be done in many ways. For example, we can find the x value of our first point. In this case, it will be 2010. Now we can set xAxis.min property to e. g. 2008. Then, we can use plotBands to color background between 2008 and 2010 and render text "NO DATA BEFORE 2010" using chart.renderer method.

You can find a simplified example of it here: https://jsfiddle.net/BlackLabel/6fqzxuvy/

API Reference: https://api.highcharts.com/class-refere ... art#update
https://api.highcharts.com/highcharts/xAxis.plotBands
https://api.highcharts.com/class-refere ... derer#text
https://api.highcharts.com/highcharts/xAxis.min

Best regards!
Rafał
Rafal Sebestjanski,
Highcharts Team Lead
httpete
Posts: 11
Joined: Tue Feb 13, 2018 3:13 pm

Re: Beginning of Time / Epoch Indicator?

Wow fantastic, exactly what I want! How can I add this globally to all highcharts in my app via setOptions?
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Beginning of Time / Epoch Indicator?

httpete,

It's hard to say because I don't know your app and your file structure.

https://www.highcharts.com/docs/getting ... irst-chart
Here you can read about how to set options for your chart. Try to find these options and copy your new code there.

Rafał
Rafal Sebestjanski,
Highcharts Team Lead
httpete
Posts: 11
Joined: Tue Feb 13, 2018 3:13 pm

Re: Beginning of Time / Epoch Indicator?

We initialize highcharts in one place in the app, I was hoping for a global option but possible a plugin is the only way we could get this band on all charts?
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Beginning of Time / Epoch Indicator?

Hi httpete,

My answer is the same as in the previous post. I will not be able to help you if you do not give me more information. Chart options can be applied to projects in tens of different ways depending on file structures, amount of charts, tech stack and many other things.
Rafal Sebestjanski,
Highcharts Team Lead

Return to “Highcharts Usage”