using .highcharts() to assign options
See original GitHub issueI wanted to do something like http://www.highcharts.com/demo/synchronized-charts. While I had my npm compiler running and listening for file changes (npm start which is “npm run tsc:w” and “npm run lite”), everything works well (with following errors … but works great). However, when I restart my “npm start” and it goes through the compiler again, I get
[0] app/station-dashboard.component.ts(249,10): error TS2345: Argument of type ’ { chart: { marginLeft: number; zoomType: string; spacingTop: number; spacingBott om: number; }; ti…’ is not assignable to parameter of type ‘HighchartsOptions’ . [0] Types of property ‘series’ are incompatible. [0] Type ‘{ data: any; name: any; color: any; fillOpacity: number; tooltip: { valueSuffix: string; }; }[]’ is not assignable to type ‘HighchartsIndividualSe riesOptions[]’. [0] Type ‘{ data: any; name: any; color: any; fillOpacity: number; tooltip : { valueSuffix: string; }; }’ is not assignable to type ‘HighchartsIndividualSe riesOptions’. [0] Object literal may only specify known properties, and ‘color’ does n ot exist in type ‘HighchartsIndividualSeriesOptions’.
It’s not liking where I say :
$('<chart class="stationChart col-md-12">')
.appendTo(‘#container’)
.highcharts({
chart: {
marginLeft: 80, // Keep all charts left aligned
zoomType: ‘x’,
spacingTop: 20,
spacingBottom: 20
},
How can I make it so I can call .highcharts ( ) and pass in options there?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:34 (4 by maintainers)
@sspilleman Try to set
options: Object;
rather thanoptions: HighchartsOptions;