Skip to content

Instantly share code, notes, and snippets.

@Mohamedemad4
Last active December 25, 2019 20:51
Show Gist options
  • Save Mohamedemad4/95883d11d5897d5e5d540dd3618e3644 to your computer and use it in GitHub Desktop.
Save Mohamedemad4/95883d11d5897d5e5d540dd3618e3644 to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<style id="jsbin-css">
@import url(https://fonts.googleapis.com/css?family=Roboto);
body {
font-family: Roboto, sans-serif;
}
#chart {
max-width: 650px;
margin: 35px auto;
}
</style>
<div id="chart">
</div>
<script id="jsbin-javascript">
var options = {
chart: {
type: 'area'
},series: [{
data: [[1, 34], [3, 54], [5, 23] , [15, 43]]
}],
fill: {
type: 'solid' ,
colors: [
function( value, seriesIndex, w ) {
console.log(value);
if (value < 15) {
return '#7E36AF';
} else {
return '#D9534F';
}
}
]
}}
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
</script>
<script id="jsbin-source-css" type="text/css">@import url(https://fonts.googleapis.com/css?family=Roboto);
body {
font-family: Roboto, sans-serif;
}
#chart {
max-width: 650px;
margin: 35px auto;
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">var options = {
chart: {
type: 'area'
},series: [{
data: [[1, 34], [3, 54], [5, 23] , [15, 43]]
}],
fill: {
type: 'solid' ,
colors: [
function( value, seriesIndex, w ) {
console.log(value);
if (value < 15) {
return '#7E36AF';
} else {
return '#D9534F';
}
}
]
}}
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();</script>
@import url(https://fonts.googleapis.com/css?family=Roboto);
body {
font-family: Roboto, sans-serif;
}
#chart {
max-width: 650px;
margin: 35px auto;
}
var options = {
chart: {
type: 'area'
},series: [{
data: [[1, 34], [3, 54], [5, 23] , [15, 43]]
}],
fill: {
type: 'solid' ,
colors: [
function( value, seriesIndex, w ) {
console.log(value);
if (value < 15) {
return '#7E36AF';
} else {
return '#D9534F';
}
}
]
}}
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment