Skip to content
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

change color of data series #474

Open
zhengniu opened this issue Oct 2, 2020 · 0 comments
Open

change color of data series #474

zhengniu opened this issue Oct 2, 2020 · 0 comments

Comments

@zhengniu
Copy link

zhengniu commented Oct 2, 2020

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" } ] } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant