Esri / Esri/cedar

change color of data series

Open
#474 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Handlebars
Stars
265
Forks
236
PR merge metrics
No merged PRs in 30d

Description

Hi,

any one can help to explain how to use "overrides" to customize colors of data series? I want to change color of each line plot to new colors as below. but seems like "overrides" has no properties for series.
thanks alot for your help

"style": {"colors": ["#b2e2e2"]},
"style": {"colors": ["#edf8fb"]},
"style": {"colors": ["#66c2a4"]},
"style": {"colors": ["#238b45"]},
"style": {"colors": ["#fef0d9"]},
"style": {"colors": ["#fdcc8a"]},
"style": {"colors": ["#fc8d59"]},
"style": {"colors": ["#d7301f"]},

`{
"type": "line",
"datasets": [
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/ArcGIS/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 AM ATS Truck EB",
"query": {
"where": "hwy_num = '401' and dir=1 and type='truck'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "am_ats",
"outStatisticFieldName": "am_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/arcgis/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 PM ATS Truck EB",
"query": {
"where": "hwy_num = '401' and dir =1 and type='truck'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "pm_ats",
"outStatisticFieldName": "pm_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/arcgis/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 AM ATS Truck WB",
"query": {
"where": "hwy_num = '401' and dir =-1 and type='truck'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "am_ats",
"outStatisticFieldName": "am_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/arcgis/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 PM ATS Truck WB",
"query": {
"where": "hwy_num = '401' and dir =-1 and type='truck'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "pm_ats",
"outStatisticFieldName": "pm_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/ArcGIS/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 AM ATS Car EB",
"query": {
"where": "hwy_num = '401' and dir=1 and type='car'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "am_ats",
"outStatisticFieldName": "am_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/arcgis/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 PM ATS Car EB",
"query": {
"where": "hwy_num = '401' and dir =1 and type='car'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "pm_ats",
"outStatisticFieldName": "pm_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/arcgis/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 AM ATS Car WB",
"query": {
"where": "hwy_num = '401' and dir =-1 and type='car'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "am_ats",
"outStatisticFieldName": "am_ats"
}
]
},
"join": "week"
},
{
"url": "https://services.arcgis.com/6iGx1Dq91oKtcE7x/arcgis/rest/services/bi_dirGGH_car_truck_weekly/FeatureServer/0",
"name": "401 PM ATS Car WB",
"query": {
"where": "hwy_num = '401' and dir =-1 and type='car'",
"orderByFields": "week",
"groupByFieldsForStatistics": "week",
"outStatistics": [
{
"statisticType": "sum",
"onStatisticField": "pm_ats",
"outStatisticFieldName": "pm_ats"
}
]
},
"join": "week"
}
],
"series": [
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "am_ats",
"label": "401 EB AM ATS Truck"
},
"source": "401 AM ATS Truck EB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "pm_ats",
"label": "401 EB PM ATS Truck"
},
"source": "401 PM ATS Truck EB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "am_ats",
"label": "401 WB AM ATS Truck"
},
"source": "401 AM ATS Truck WB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "pm_ats",
"label": "401 WB PM ATS Truck"
},
"source": "401 PM ATS Truck WB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "am_ats",
"label": "401 EB AM ATS Car"
},
"source": "401 AM ATS Car EB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "pm_ats",
"label": "401 EB PM ATS Car"
},
"source": "401 PM ATS Car EB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "am_ats",
"label": "401 WB AM ATS Car"
},
"source": "401 AM ATS Car WB"
},
{
"category": {
"field": "week",
"label": "Week"
},
"value": {
"field": "pm_ats",
"label": "401 WB PM ATS Car"
},
"source": "401 PM ATS Car WB"
}
],
"overrides": {
"valueAxes": [
{
"title": "Speed (km/hr)"
}
],
"categoryAxis": {
"title": "Week",
"guides": [
{
"category": "Mar-16 to Mar-20",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "State of Emergency"
},
{
"category": "May-11 to May-15",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "Stage 1 - reopening"
},
{
"category": "Jun-08 to Jun-12",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "Stage 2 - reopening"
},
{
"category": "Jul-13 to Jul-17",
"lineColor": "#CC0000",
"lineAlpha": 1,
"dashLength": 2,
"inside": true,
"labelRotation": 90,
"label": "Stage 3 - reopening"
}
]
}
}
}`

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the chart configuration's series and overrides sections, including the eight series definitions and the existing valueAxes and categoryAxis overrides. Determine whether per-series colors are documented or supported, then clarify the configuration needed to assign each requested color and show how completion can be verified in the example chart.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.