-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow single datapoint to have different color - fixes #467
- Loading branch information
1 parent
38c7b00
commit b42bcef
Showing
13 changed files
with
260 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Basic Column - Grouped</title> | ||
|
||
|
||
<link href="../../assets/styles.css" rel="stylesheet" /> | ||
|
||
<style> | ||
#chart { | ||
max-width: 650px; | ||
margin: 35px auto; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id="chart"> | ||
|
||
</div> | ||
|
||
|
||
<script src="../../../dist/apexcharts.js"></script> | ||
|
||
<script> | ||
var options = { | ||
chart: { | ||
height: 350, | ||
type: 'bar', | ||
}, | ||
plotOptions: { | ||
bar: { | ||
horizontal: false, | ||
columnWidth: '60%' | ||
}, | ||
}, | ||
stroke: { | ||
show: true, | ||
width: 2, | ||
}, | ||
dataLabels: { | ||
enabled: false | ||
}, | ||
series: [{ | ||
name: 'Yearly Profit', | ||
data: [{ | ||
x: '2011', | ||
y: 1292 | ||
}, { | ||
x: '2012', | ||
y: 4432 | ||
}, { | ||
x: '2013', | ||
y: 5423 | ||
}, { | ||
x: '2014', | ||
y: 6653 | ||
}, { | ||
x: '2015', | ||
y: 8133, | ||
fillColor: '#EB8C87', | ||
strokeColor: '#C23829' | ||
}, { | ||
x: '2016', | ||
y: 7132 | ||
}, { | ||
x: '2017', | ||
y: 7332 | ||
}, { | ||
x: '2018', | ||
y: 6553 | ||
}] | ||
}], | ||
yaxis: { | ||
labels: { | ||
formatter: function(val) { | ||
return val / 1000 + 'K $' | ||
} | ||
} | ||
}, | ||
fill: { | ||
opacity: 1, | ||
}, | ||
xaxis: { | ||
type: 'datetime' | ||
} | ||
} | ||
|
||
var chart = new ApexCharts( | ||
document.querySelector("#chart"), | ||
options | ||
); | ||
|
||
chart.render(); | ||
|
||
|
||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b42bcef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junedchhipa This change does not work for heatmap, could you also add this feature for heatmap ? Tested on 3.6.11, the latest version.
My real problem is that current color scale is linear, it does not work so good when values have big difference. So either it support other scale like pow scale or allow us to customize the color for each data point work for me, any suggestion ?
b42bcef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check again how it can be tweaked for heatmap charts too.
b42bcef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks
b42bcef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junedchhipa just wonder if you fixed this feature for heatmap, did not find any info from document. thanks in advance.
b42bcef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, I missed this one.
Can you please create an issue so I can track it better?
b42bcef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junedchhipa I created a issue for this , #717 . Thank you very much.