FVANCOP / ChartNew.js

MIT License
420 stars 142 forks source link

AnimationstartWithData does not work correctly with animationLeftToRight #405

Open soodrah opened 8 years ago

soodrah commented 8 years ago

Hi Fvancop, Thanks for this feature. This is related to issue59 link to issue 59. This feature lets me animate portions of data. Except there is a problem that it does not work correctly with animationLeftToRight. I am using animation_lines.html to illustrate the issue.

Here is the dataSet datasets : [ { fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,1)", pointColor : "rgba(220,220,220,1)", pointstrokeColor : "yellow",

    data : [95,53,99,,73,27,82],

// data : [40],

title : "2014" }, { fillColor : "rgba(151,187,205,0.5)", strokeColor : "rgba(151,187,205,1)", pointColor : "green", pointstrokeColor : "yellow", data : [35,43,59,,31,50,66], // data : [35], title : "2013" } ]

I would like to animate only from the data point 66 in [35,43,59,,31,50,66]. This works good if i am not using animationLeftToRight. As soon as I use that option the animation for the portion 66 just does not happen instead that portion of the graph just fills in after few seconds. Can we have a fix for this soon, I am evaluating this library for use in a new project. Will appreciate quick turnaround. FYI, I am a very good java developer, just ok in javascript. I am using GWT in my project so will be writing GWT java wrappers for this Library i.e. using JSNI and Java overlay Types. Once done I can make that part of this open source. I am hoping you can fix this so that can use this library.

Here are the options i am using, taken from animation_lines.html, see the changes to animationStartWithDataset and animationStartWithData

var opt1 = { animationStartWithDataset : 2, animationStartWithData : 7, animationLeftToRight:true, animationEasing:"linear", animationSteps : 200, canvasBorders : true, canvasBordersWidth : 3, canvasBordersColor : "black", graphTitle : "default animation", legend : true, inGraphDataShow : true, annotateDisplay : true, graphTitleFontSize: 18

}

FVANCOP commented 8 years ago

You are right : there is a bug if you set "animationStartWithData : 7" and "animationStartWithDataset : 2" ; But with those values, the chart should not be animated at all. When the animation goes left to right, the animation start after the point associated to value of animationStartWithData. As specified by @markosko in issue #59 , you should specify "animationStartWidthData : 6" if you want to get an chart animated between the before last (point 6) and the last points (point 7).

I will fix this when I publish a new update of ChartNew.js (currently working on some bugs detected on iPhone).

soodrah commented 8 years ago

hi Francois

thanks, that makes sense. In my application the graph will animate until 66 and when the user presses the button it will start animating from 66 but of course by then I will have more data filled into my array so that should work. i will test that part and let you know if it works

On Sun, Jan 3, 2016 at 4:36 PM, Francois Vancoppenolle < notifications@github.com> wrote:

You are right : there is a bug if you set "animationStartWithData : 7" and "animationStartWithDataset : 2" ; But with those values, the chart should not be animated at all. When the animation goes left to right, the animation start after the point associated to value of animationStartWithData. As specified by @markosko https://github.com/markosko in issue #59 https://github.com/FVANCOP/ChartNew.js/issues/59 , you should specify "animationStartWidthData : 6" if you want to get an chart animated between the before last (point 6) and the last points (point 7).

I will fix this when I publish a new update of ChartNew.js (currently working on some bugs detected on iPhone).

— Reply to this email directly or view it on GitHub https://github.com/FVANCOP/ChartNew.js/issues/405#issuecomment-168542529 .

Rahul Sood Software Engineer/Java Developer/Web Developer/C++Programmer/JasperReports and IText Developer/Expert in J2EE, JSF, HTML, Javascript, EJB2.1 etc.

Work Experience Includes companies like Credit Suisse MICROS (Leader in Hospitality Industry) Lockheed Martin (Defence Leader) DUKE Medical Center Carefirst Blue Cross Blue Shield C 9195610975

soodrah commented 8 years ago

hi Francois

Question - Can your chartNew.js accept JSON strings or should I use only Javascript Object when I write the Java wrappers for the charNew.js library

On Sun, Jan 3, 2016 at 4:55 PM, rahul sood soodrah@gmail.com wrote:

hi Francois

thanks, that makes sense. In my application the graph will animate until 66 and when the user presses the button it will start animating from 66 but of course by then I will have more data filled into my array so that should work. i will test that part and let you know if it works

On Sun, Jan 3, 2016 at 4:36 PM, Francois Vancoppenolle < notifications@github.com> wrote:

You are right : there is a bug if you set "animationStartWithData : 7" and "animationStartWithDataset : 2" ; But with those values, the chart should not be animated at all. When the animation goes left to right, the animation start after the point associated to value of animationStartWithData. As specified by @markosko https://github.com/markosko in issue #59 https://github.com/FVANCOP/ChartNew.js/issues/59 , you should specify "animationStartWidthData : 6" if you want to get an chart animated between the before last (point 6) and the last points (point 7).

I will fix this when I publish a new update of ChartNew.js (currently working on some bugs detected on iPhone).

— Reply to this email directly or view it on GitHub https://github.com/FVANCOP/ChartNew.js/issues/405#issuecomment-168542529 .

Rahul Sood Software Engineer/Java Developer/Web Developer/C++Programmer/JasperReports and IText Developer/Expert in J2EE, JSF, HTML, Javascript, EJB2.1 etc.

Work Experience Includes companies like Credit Suisse MICROS (Leader in Hospitality Industry) Lockheed Martin (Defence Leader) DUKE Medical Center Carefirst Blue Cross Blue Shield C 9195610975

Rahul Sood Software Engineer/Java Developer/Web Developer/C++Programmer/JasperReports and IText Developer/Expert in J2EE, JSF, HTML, Javascript, EJB2.1 etc.

Work Experience Includes companies like Credit Suisse MICROS (Leader in Hospitality Industry) Lockheed Martin (Defence Leader) DUKE Medical Center Carefirst Blue Cross Blue Shield C 9195610975

markosko commented 8 years ago

bug is only when u set animationStartWidthData to last point of graph so its wont be problem if there will be more points after 66, and about json from json u can extract array of values and data part from json