Sunday, March 22, 2020

Function

lets create a function call axisBreaker(). this is the main function for this task.

now simply we can create a axisbreak inside the method like follow.

var axisBreak = valueAxis.axisBreaks.create();      <--- initialize  amchart4 axis breaker
axisBreak.startValue = 2100;        <--- initialize the breaking start point
axisBreak.endValue = 22900;       <--- initialize the breaking end point
axisBreak.breakSize = 0.005;       <--- initialize the breaking area size



this axisBreaker() must pass these parameter.


1. data { data set array - pass the all set of values }
2. yProp { variable name - yAxis property }
3. valueAxis { property of value axis in am charts4 }
4. axisBreak { property of axisBreak in am charts4 }

now our first function looks like  --> axisBreaker(data, yProp, valueAxis, axisBreak)



this is the min and max value of whole chart.
Get the height of min as X.
Get the Height of max as Y.
If (K)X < Y chart will break. {(K = 1,2,3,4,...)}

Then get M = (X+Y)/2.
Chart will be compressed by a value of X from M, both upwards and downwards.(total of 2X will be compressed)

No comments:

Post a Comment