Fix #11721 Add support for line traces classification#11733
Fix #11721 Add support for line traces classification#11733allyoucanmap merged 9 commits intogeosolutions-it:masterfrom
Conversation
…into feat/add-line-classification
…at/add-line-classification
…at/add-line-classification
There was a problem hiding this comment.
There is an error by following these steps:
- open a new dashboard
- create a new chart with
mapstore:stateslayer on gs-stable - select Line Chart trace
- select
state_nameas X Attribute - select
land_kmas Y Attribute - select AVG as Operation
- select Classification style
- select
sub_regionas Classification Attribute - now switch the chart trace to Bar Chart
- switch again the trace to Line Chart
- select Classification style
Expected:
- chart builder is visible wit the correct preview
Current:
- error in console and grey page
Note: this seems to happen with the specific mapstore:states layer
| enableBarChartStack, | ||
| FONT | ||
| FONT, | ||
| DEFAULT_CLASSIFICATION |
There was a problem hiding this comment.
why do we need DEFAULT_CLASSIFICATION? Are we doing a similar thing in bar chart?
| { value: 'lines', label: 'Line' }, | ||
| { value: 'markers', label: 'Scatter' } | ||
| { value: 'markers', label: 'Scatter' }, | ||
| { value: 'classification', label: <Message msgId={'styleeditor.classificationStyle'} /> } |
There was a problem hiding this comment.
From UI I think we should split the mode from msMode property and have two select. This means we should have:
msModeproperty select with two options (labelMode):- Simple style
- Classification style
modeproperty select with three options (labelType):- Line with markers
- Line
- Scatter
Note: when we switch from Simple to Classification style we may need to manage the Line with markers options because it needs two different colors one for line and one for markers. I think we could hide Line with markers when classification style is selected.
In this way we will be able to use the scatter chart in classification mode
…at/add-line-classification
- Add the msMode with simple and classification options - Add the type with line, scatter, line + marker options - Displays the charts based on selected msMode and type values
|
@ElenaGallo please test this enhancement on dev, thanks |
|
@allyoucanmap here are some notes from my test: 1_ Once the line chart widget is added to the dashboard, it is not possible to select individual items in the legend and view them on the chart. Expected Behavior 2_chart.mp4Current Behavior 1_chart.mp42_ When switching from a bar chart to a line chart, the classification style option causes an error. 3_chart.mp4 |
Description
This PR adds the classification mode for the line chart so that the line traces can be categorized for the visualization.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
Currently, the line trace only supports line, line+marker, and scatter type charts.
#11721
What is the new behavior?
The line traces type will have classification style in dropdown and after it is selected the line traces will be categorized according to the classification attribute field selected.


Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information