-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hope xAxis of Stack Line support value #18437
Comments
yes, xAxis of Stack Line supports value, Demo Code |
@helgasoft In the demo you provided, only the default value of xAxis: category is used. Below is a screenshot of the complete options in the demo. In fact, when the value of xAxis.type is set to value, xAxis.data cannot be assigned, and all data will be in series, such as series[0].data = [[1, 2], [2, 3], [3, 4]]. |
@carlshe, thank you for pointing that out. I still do not understand why type='value' is needed for your data. |
Stack line with value axis may have some logic problems. For example, if the data of one series is |
Dear helgasoft,
Thank you for your quick reply!
I use ECharts' stack area map to express the geological profile/section. The geological profile data comes from the sampling analysis of geological boreholes. Each borehole has a spatial location. Generally, the boreholes are not uniformly distributed on the profile line. But stack area map treats the data of xAxis as discrete quantities (‘category’) uniformly distributed on the x-axis, and then cannot reflect the distance relationship between the boreholes.
As follow map shown, there are 3 boreholes located on the profile line, the distance between first and second borehole is 16m, the distance between second and third borehole is 8m. The presented 3 boreholes are uniformly distributed on the xAxis. It will be best the visual interval between second and third is half of that between first and second.
![image](https://user-images.githubusercontent.com/4974493/229025356-565766ff-9d82-49e4-af49-6660dacb3ac7.png)
Could please help giving a solution for it?
Thank you again!
Carlshe
At 2023-03-30 03:52:48, "helgasoft" ***@***.***> wrote:
@carlshe, thank you for pointing that out.
I forgot what the documentations says - when "axis.data is specified, the type is auto set as 'category'"
I still do not understand why type='value' is needed for your data.
Could you provide a data sample to see the problem with "x direction...scaled by x value" ?
Geological profiles are interesting, maybe we can come up with a solution.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you Ovilia, I just hope while using stacked area map, the xAxis can reflect comparable continuous quantity. Currently the data of xAxis is treated as discrete identification. above link shows the data of xAxis of stack area map is treated as identification, not continuous value. Could please also refer my reply to helgasoft? |
Thank you very much, helgasoft! I tried your demo. It seems not suitable for me. Because the lines are not stable. The circumscribed polygon of the thematic river map is a symmetric graph. Any a item change will result in vertical adjust of bottom, top or middle lines to ensure it becomes symmetric again. In stack area map, item change only take effect on its neighbor. The bottom is stable. If stack area map really doesn't support continuous x value, is it possible to derive sub type from stack area map to improve its rendering? |
if boreholes are of different depth, an additional 'unknown' layer can be added at the bottom |
Thank you very much, helgasoft! The circumscribed polygon of the thematic river map is a symmetric graph. Any a item change, even small, will result in vertical adjust of bottom, top or middle lines to ensure it becomes symmetric again. In stack area map, item change only take effect on its neighbor. The bottom is always stable. I tried your new demo, and found that at x-24, the bottom moves a little up, and the top moves a little down. If stack area map really doesn't support continuous x value, is it possible to derive a sub type from stack area map to improve its rendering? by overriding/modifying part of its rendering process? |
My mistake: last data line should be [24, 19, 'unknown'] instead of [24, 18, 'unknown']. If values sums of all three boreholes are the same (80), then the chart remains a rectangle.
I cannot really answer that because I work at API level and do not do development (yet). But by what @Ovilia said earlier about the logic problem, it looks, hmm... impossible. |
I understand your care. I have a question? For 'category', if the data is ordered numbers, is it possible to expose an option to tell echart to treat these categories as x values, so the line points could be rendered at expected x-locations? Or is it possible to derive a sub type from stack area map to improve its rendering? by overriding/modifying part of its rendering process, especally the function that get the rendering coords from [category,y-value]? Thanks! |
ECharts can do the same - Demo Code |
Thank you, helgasoft! I tested your demo code. I think it is essentially still original category type of xAxis. All the data defined for x_Axis is discrete identification. All the x-coord node must be prdefined in xAxis and evenly distributed over x-axis, and all feature points must locate at exactly one of the predefined x-coords. But for geological profile or any other similar polylines, the feature point could be at any a x-coord. Highchart has no much limit on x of Stack area map, except that all the layers should share the single data definition of x-categories. Values in x data set are not required evenly distributed over x-axis. Hope ECharts could provide similar function as soon. |
@carlshe I don't understand. If you have such requirement, why don't using category x axis? |
I encountered the same problem as @carlshe and also looking forward for stack supporting xaxis type=value. None of the proposed solutions are solving this problem. @Ovilia to you point on having data on different x locations, you could accept only values being provided on xaxis->data, then the points will be co-located. Alternatively you could check if points are co-located when provided in series and throw error if they are not. Ultimate solution would be to do interpolation, but supporting at least co-located would be great. |
Maybe because no sample data was ever given...? Sorry but "not uniformly" "co-located" "interpolation" sound confusing to me without real data. The Highchart example is also given without data. disclaimeropinions expressed in this post are strictly personal, as ECharts user, not a developer |
Guesswork continues... here is an Updated Demo with "sampling categorization", for lack of a better word. |
@helgasoft xaxis
series 1 (y1)
series 2 (y2)
Plotted as category line: Plotted as category stack: Plotted as value line: Problem I want this data to be presented as 'stack'. You can clearly see that two line plots appear visually different. In the category plots, it seems that y1 is not a linear function as has a kink arround x=14. The y2 line has larger period in x in [14, 20] and shorter period in x in [0, 14]. In the value plot you can see that y1 is actually a linear function (the small off-linearity is due to roundoff error), and y2 is regular periodic function without any changes in periods. This data plotted as 'category' creates confusion to the receiver, because datapoint lay in mathematically incorrect locations. User can incorrectly conclude that y1 is non-linear and y2 is not regularly periodic. In general any (x, y) data represented by real numbers should always be presented as 'values' and never as 'categories'. See plotting in Matlab, python, gnuplot, excel or any other plotting tools. The solution you proposed in the last plot, in my example I would need to put sampling in 0.01 intervals, which is 2000 points instead of 58 (dataset size). But in general case (interval are real numbers) this is not possible to find such interval. Finally, you can make a restriction that x values are common for both y1 and y2. I.e., there is not such x point of series 1 for which we don't have data from series 2 and vice versa. |
Aah what a beauty, a model for problem/feature presentation, great job @maciej-flexcompute !
Curious on the reason behind this statement. A constant step (interval) is crucial for the algorithm.
That may eventually help depending on what comes out of the previous question. But hope this limitation won't be necessary. Latest Demo, essentially redrawing the lines with new X-values with a fixed step (smp). |
Your example looks exactly like what I am looking for.
Here is the proof:
Mathematically it is not possible, but numerically it is possible since we represent numbers in double precision, so at least 1e-16 can work. And practically speaking human cannot visually distinguish ~1e-5, so I guess your method will solve this problem. |
What problem does this feature solve?
Currently, stack line only support category xAxis. Could xAxis support value so the x direction could be scaled by x value?
If so, Echarts could be used for simulating the geological profile, which is composed of connected rock/soil layer points.
What does the proposed API look like?
Just providing the value type for xAxis for stack line.
The text was updated successfully, but these errors were encountered: