Skip to main content

css

Optional. Adds style classes to Chart

css?: string;

Example‚Äč

<style>
.custom {
--dhx-background-primary: #444;
--dhx-font-color-secondary: #fff;
}
.custom .chart.bar {
fill: orange;
}
</style>

<script>
const chart = new dhx.Chart("chart_container", {
type: "bar",
css: "custom dhx_widget--bordered",
scales: {
"top": {
size: 100
},
"bottom" : {
text: "month", size: 100
},
"left" : {
size: 100, maxTicks: 10, max: 100, min: 0
},
"right": {
size: 100
}
},
series: [
{
id: "A", value: "company C", color: "#5E83BA",
pointType: "circle", fill: "#5E83BA", size: 35
}
]
});
</script>

Related sample: Chart. Styling (custom CSS)

Note, that the DHTMLX library provides a set of own CSS classes that you can also apply to change the appearance of Chart:

const chart = new dhx.Chart("chart_container", {
css: "dhx_widget--bg_white dhx_widget--bordered"
});

Related articles: