Ngx-charts: how to change color schema in charts

Created on 10 Aug 2017  路  5Comments  路  Source: swimlane/ngx-charts

i need to change color schema in line chart like demos in here https://swimlane.github.io/ngx-charts/#/ngx-charts/line-chart . Need example plz,plunker may be good

Most helpful comment

You can look at the code of the demo page for that:

https://github.com/swimlane/ngx-charts/blob/master/demo/app.component.ts#L408

The color schemes need to have the following format:

{
  domain: ['#000000', '#FF0000']
}

These are the built-in color schemes into the library:
https://github.com/swimlane/ngx-charts/blob/master/src/utils/color-sets.ts
You can also reference these by the name

All 5 comments

You can look at the code of the demo page for that:

https://github.com/swimlane/ngx-charts/blob/master/demo/app.component.ts#L408

The color schemes need to have the following format:

{
  domain: ['#000000', '#FF0000']
}

These are the built-in color schemes into the library:
https://github.com/swimlane/ngx-charts/blob/master/src/utils/color-sets.ts
You can also reference these by the name

These are the built-in color schemes into the library:
https://github.com/swimlane/ngx-charts/blob/master/src/utils/color-sets.ts
You can also reference these by the name

Could you explain how? i.e. I want to use the 'vivid' colorset, and setting [scheme] to 'vivid' just creates lots of errors about
Cannot read property 'scaleType' of undefined

These are the built-in color schemes into the library:
https://github.com/swimlane/ngx-charts/blob/master/src/utils/color-sets.ts
You can also reference these by the name

Could you explain how? i.e. I want to use the 'vivid' colorset, and setting [scheme] to 'vivid' just creates lots of errors about
Cannot read property 'scaleType' of undefined

just say scheme="flame"

These are the built-in color schemes into the library:
https://github.com/swimlane/ngx-charts/blob/master/src/utils/color-sets.ts
You can also reference these by the name

Could you explain how? i.e. I want to use the 'vivid' colorset, and setting [scheme] to 'vivid' just creates lots of errors about
Cannot read property 'scaleType' of undefined

just say scheme="flame"

[xAxis]="showXAxis" [yAxis]="showYAxis" [legend]="showLegend" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [xAxisLabel]="xAxisLabel" [yAxisLabel]="yAxisLabel" (select)="onSelect($event)">

You can look at the code of the demo page for that:

https://github.com/swimlane/ngx-charts/blob/master/demo/app.component.ts#L408

The color schemes need to have the following format:

{
  domain: ['#000000', '#FF0000']
}

These are the built-in color schemes into the library:
https://github.com/swimlane/ngx-charts/blob/master/src/utils/color-sets.ts
You can also reference these by the name

Can you please share how to reference it by name

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kakalos12 picture kakalos12  路  4Comments

Hypercubed picture Hypercubed  路  3Comments

lokeshdaiya picture lokeshdaiya  路  3Comments

achimha picture achimha  路  3Comments

faisalnet5 picture faisalnet5  路  3Comments