amCharts support forum

You are not logged in.

Announcement

FORUM CLOSED! This forum is closed. We moved to a new place at Zendesk. Update your bookmarks.

Other topics: Your implementations


#1 2012-06-12 23:23:26

cyhung
Member

Line Chart to graph trends and key date-based milestones

I needed to plot the trends of two sets of yearly data and a set of key dates ("milestones") on the same timeline.
And then have a html text block appear when user interact with the key dates.
http://www.edweek.org/ew/section/multim … eline.html

This isn't too complicated an implementation. So I hope it's OK to post example like this one.
I am just so glad that I could use amChart to do this mainly by relying on working to create a customized data file. And then manipulating the many events and parameters available. e.g. The third set of data has nothing to do with the other two. So the "connect = false" parameter allowed me to skip value if set to undefined. Setting urlField to "#" so that cursor changes to a hand etc.

Also, using an external txt file to handle the html text block was so much easier than I thought.  I just needed to have the columns separated by | instead of , for flexibility with description fields which have commas in the text.

However, some problems:

The first of the two problems I experienced while doing this was when I set chartCursor.pan = true. My browsers (FF, Chrome) kept crashing when I tried to dragged and pan the chart. I changed it to false and just relied on the scrollbar instead.

The second problem is when I looked at the chart on my iPad. Everything works except I could 1) successfully tap/click the "show all" button 2) trigger the onclick event on the key dates. I'm not sure if this is a known issue or not.

Anyway, so happy with amChart right now. Looking forward to future releases :)

Last edited by cyhung (2012-06-12 23:43:52)

Offline

 

#2 2012-06-14 01:09:39

martynasma
Administrator

Re: Line Chart to graph trends and key date-based milestones

Great job! The chart looks very nice and functional.

As for iPad, just checked your site, tapping "show all" works fine for me. As for click events not registering, it might be due to ChartCursor. For the sake of test try disabling it and see if the clicks start registering.

Offline

 

#3 2012-06-14 10:04:17

cyhung
Member

Re: Line Chart to graph trends and key date-based milestones

@qemm thanks for the comment and suggestion. i'll test it out w/o the chartCursor and see if that's the culprit.

Offline

 

#4 2012-06-19 13:39:32

cyhung
Member

Re: Line Chart to graph trends and key date-based milestones

@qemm

ok! I finally got back to testing this.
Here's what I found as the testing result on iPad:

1. I disabled chartcursor. but then rollover action doesn't seem to work with bullets anymore. So I couldn't get any of the values to show up when rolled over. click event also didn't fire. no rollover is a bigger problem. so i enabled chartCursor again.
2. I then commented out chart.panEventsEnabled = true; as a test since I know that's a mobile specific parameter amchart uses. And the rollover and clickevent all started to work! BUT the zoom and pan for scrollbar don't work anymore. This is less of a problem since the most important thing is to have the milestone's clickevent and other bullets' rollover event work. So I left this change in implementation live. You can see the updated version here:
http://www.edweek.org/ew/section/multim … eline.html

So it looks like an issue related to scripts about panEventsEnabled ?

Offline

 

#5 2012-06-20 05:23:56

martynasma
Administrator

Re: Line Chart to graph trends and key date-based milestones

Yes, it could be that pan events are stealing the click events from the bullets.

Anyway, does the chart work for you as you want it to work?

Offline

 

#6 2012-06-20 15:42:27

cyhung
Member

Re: Line Chart to graph trends and key date-based milestones

@qemm

it's 99% of how I wished it'd work. the 1% being now that on iPad, users can't zoom in/out & pan with the scrollbar.
small thing so I won't lose sleep over it. :)

possible panEvent bug fix for future release of amcharts? :)

tnx!

Offline

 

© amCharts | Forum engine: PunBB