amcharts / amstock2

JavaScript Stock Chart V2
Other
2 stars 2 forks source link

different Timezones #1

Open guntram opened 8 years ago

guntram commented 8 years ago

Hi!

I am currently dealing with implementing timezones in an AmStockChart. I can manage to set the axis correctly, but the cursor doesn't seem to be accessible.

Your demo @: http://www.amcharts.com/tips/displaying-time-multiple-time-zones-stock-chart-category-axis/ claims to be able to handle different timezones, but when i change my OS timezone, the chart displays a slightly different curve regarding the time.

Is there a possibility to hook into the chartCursor in an AmStockChart, is there a possibility to overwrite the function concerning the chartCursor handling, or do I have to dig the minified code to fix this issue?

Thanks and regards, Guntram

martynasma commented 8 years ago

Yes, you can use categoryBalloonFunction to modify cursor's balloon the same way as category axis':

http://docs.amcharts.com/3/javascriptstockchart/ChartCursorSettings#categoryBalloonFunction

guntram commented 8 years ago

Thanks for the answer!

Unfortunately, I get a hell of errors if i upgrade from v2 to v3...

The question was about v2 :)

martynasma commented 8 years ago

My bad. V2 was so long ago :)

The example you referred to was for V3, though. Are you getting errors there as well? Or is it with just your particular setup.

We can try working that out. Please contact us at contact@amcharts.com to discuss this further.

guntram commented 8 years ago

You can open the chart and change the OS timezone. The curve will be different in different timezones.

The task would be to be able to show data from Europe in the USA for example, and the data should always look the same. That's what I am currently struggling with a little :)

martynasma commented 8 years ago

Sorry for not getting back earlier.

Try adding the following line before any other chart code:

AmCharts.useUTC = true;

I hope that helps.

P.S. GitHub issue tracker is not being continuously monitored by amCharts staff. For faster response time, please email us directly at contact@amcharts.com

guntram commented 8 years ago

Hey Martynas!

Thanks for the hint, I will try it out asap.

And I wrote down the email address to remind me if I get another struggle task, but the timezone stuff maybe is the trickiest of all :godmode:

guntram commented 8 years ago

I made a short try and it seems that the time is still wrong for some hours, but i will go deeper when the concerning task makes it into the sprint again...