Note that example code is included after the screenshots.
The colorful image below is created using range color settings applied to a column series chart. The less colorful image is the same data, color definitions and chart definition as the first except a StepLine series is added (the line indicates a required threshold).
I can understand that color might not be applied to segments of a line (though it would be nice). Less easy to understand is why just because a line series is added to a chart, the color of the column series is removed. Is this intended behavior?
Here is code to reproduce the charts shown in the screenshot. By default it shows the less colorful chart because it include a line series. Just comment out the 'steplineSeries' from the chart series array to see the colorful one.
import { Chart, BarSeries, ColumnSeries, LineSeries, StepLineSeries, Legend, Category, DataLabel, Tooltip as ChartTooltip } from '@syncfusion/ej2-charts';
Chart.Inject(BarSeries, ColumnSeries, LineSeries, StepLineSeries, Legend, DataLabel, ChartTooltip, Category);
let columnSeries = {
"dataSource": [
{
"x": "10-Eastern Workforce Investment Area",
"y": 97.53
},
{
"x": "11-North Central Workforce Investment Area",
"y": 85.2
},
{
"x": "12-Northwest Workforce Investment Area",
"y": 77.7
},
{
"x": "13-South Central Workforce Investment Area",
"y": 90.54
},
{
"x": "14-Southwest Workforce Investment Area",
"y": 112.82
}
],
"xName": "x",
"yName": "y",
"type": "Column",
"name": "% Achieved"
}
let steplineSeries = {
dataSource: [
{
"x": "10-Eastern Workforce Investment Area",
"y": 71.5
},
{
"x": "11-North Central Workforce Investment Area",
"y": 71.5
},
{
"x": "12-Northwest Workforce Investment Area",
"y": 71.5
},
{
"x": "13-South Central Workforce Investment Area",
"y": 71.5
},
{
"x": "14-Southwest Workforce Investment Area",
"y": 71.5
}
],
xName: 'x',
yName: 'y',
type: 'StepLine',
name: 'Goal'
};
let benchmarkChart = new Chart(
{
title: 'Performance vs. Goal for Employment Q2 Adult',
titleStyle:
{
fontFamily: 'Roboto',
fontWeight: '200',
textAlignment: 'Near',
textOverflow: 'None',
size: '15px'
},
legendSettings:
{
visible: false,
mode: 'Range',
toggleVisibility: false
},
tooltip:
{
enable: true,
},
primaryYAxis:
{
title: '% Achieved',
},
primaryXAxis:
{
valueType: 'Category',
labelPosition: 'Inside',
labelStyle:
{
fontFamily: 'Roboto',
size: '15px'
},
labelPadding: 10,
labelRotation: 270,
},
series:
[
columnSeries,
steplineSeries
],
rangeColorSettings: [
{
"colors": [
"#ef5350"
],
"label": "< 6,500%",
"start": 0,
"end": 65
},
{
"colors": [
"#ef9a9a"
],
"label": "Between 6,500% and 8,999%",
"start": 65,
"end": 89.99
},
{
"colors": [
"#f9a825"
],
"label": "Between 9,000% and 9,499%",
"start": 90,
"end": 94.99
},
{
"colors": [
"#ffee58"
],
"label": "Between 9,500% and 9,999%",
"start": 95,
"end": 99.99
},
{
"colors": [
"#d0e9b3"
],
"label": "Between 10,000% and 10,990%",
"start": 100,
"end": 109.9
},
{
"colors": [
"#0adb2a"
],
"label": ">= 11,000%",
"start": 110,
"end": null
}
]
}, '#chart' );
Hi Bill,
Greetings from Syncfusion.
We have considered your reported scenario as bug and logged a defect report for this issue. This fix will be available in our weekly patch release which is scheduled to be rolled out on July 25, 2023. We appreciate your patience until then. You can keep track of the bug from the below feedback link.
Feedback: https://www.syncfusion.com/feedback/45013/range-color-mapping-is-not-working-while-using-two-series
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.
Regards,
Nishanthi
Bill,
We are glad to announce that our Essential Studio 2023 Volume 2 Service Pack Release v22.2.5 is rolled out. We have added the fix for rangeColorMapping is not working while using two series issue in this release and is available for download under the following link.
Feedback: https://www.syncfusion.com/feedback/45013/range-color-mapping-is-not-working-while-using-two-series
Sample: https://stackblitz.com/edit/5dewjt-dca9xe?file=index.ts
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Nishanthi