score:1
Using lit-element
Highcharts and its modules can be loaded like following:
import 'highcharts';
import 'highcharts/modules/exporting';
import 'highcharts/modules/boost'
import 'highcharts/highcharts-more';
Component config:
import { LitElement, html } from 'lit-element';
import 'highcharts';
import 'highcharts/modules/exporting';
import 'highcharts/modules/boost'
import 'highcharts/highcharts-more';
class ChartTest extends LitElement {
firstUpdated(changedProperties) {
this._enableChart();
}
render() {
return html`
<div id='container' style='width:500px;height:300px;border: 1px red solid;'>sfsdfs</div>
`;
}
_enableChart() {
Highcharts.chart(this.shadowRoot.querySelector('#container'), {
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
]
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: 'column'
}]
});
}
}
Source: stackoverflow.com
Related Articles
- Highchart stockChart Installation in Web Component
- Call an angular component method when we click on highchart series
- Highcharts: StockChart initialization with new Highchart
- change VueJS component data value from inside Highchart event
- Vue js + HighChart - how can I make a synchronous axios call before the component get rendered?
- Strange character in the Highstock source code
- Why does my Highchart look different when I transfer my code from Jsfiddle to my server?
- I had follow someone code samples and try apply to my HighChart program but I can't get it work at all
- How to implement date selector to HighChart StockChart in reactjs (without jQuery)
- Column based Highchart drilldown series assign color code to each column
- x-axis, y-axis lines does not appear, when I include 3D chart library of HighChart in my code
- Highchart draggable point - watch changes from component
- Old highchart data in react component when going back and forward
- why my highchart code is not working?
- HighChart Chart displaying incorrect data when switched to StockChart
- How to render Gantt Highchart from data source
- Highchart spline Cut Off when reach to maximum scale value. How can it fixed?. I have attached may sample code on body
- I am trying to include india map in my highchart code
- How to make highchart points redirect to another component with value in React?
- Highchart StockChart - Update last point value
- Angular dynamic highchart integration - response is not updating in the chart component
- Highchart map does not support IRS country code
- Highchart columnrange, color code lines based on data
- how to hide highchart x - axis data values
- Highchart specific width stack column bar graph
- Highchart - show / hide an y-Axis without hiding the series
- Manage multiple highchart charts in a single webpage
- when is a highchart completely loaded?
- Remove Export and print button plugin on highchart chart
- Drilldown multiple levels Highchart
- Highcharts draggable annotaion how to move by steps?
- highchart mysql json with dropdown select value for where condition
- How to remove space in between bars in HighCharts bar chart?
- How do I properly format HighStock x-axis ticks based on unix timestamps?
- Highcharts: Show x axis for missing data but ignoring certain area
- Few Partial Views(charts) on one page
- Adding dynamic mean to time series chart
- Loading string data from table gets parsed as Date on Chrome - Highcharts
- Highcharts nodeName of undefined
- How to show 0 value infomation in treemap highcharts
- If sentence Highcharts
- GeoJSON drawing incorrectly in Highmaps
- HighCharts: Annotation on X axis?
- Highstock with multiple series, tooltip follows points even i disabled
- Highcharts Datetime Issue
- Highcharts add single line to column chart
- Highcharts - How to have multiple datapoints per xAxis label?
- Rails Highstock Chart Installation
- Query selector for the individual buttons in range selector
- highcharts: margin between two boxplot series