i'm trying to change the border of the middle cell to give emphasis at it.
i could change border for the entire chart with series-heatmap.itemStyle but not for only one cell.
the result i'm expecting looks like the image above:
any help will be appreciated!!
[EDIT]
I found in the docs that if customization was needed for some specific item, it could be setted up in data array:
[
12,
24,
{
value: [24, 32],
// label style, only works in this data item.
label: {},
// item style, only works in this data item.
itemStyle:{}
},
33
]
// Or
[
[12, 332],
[24, 32],
{
value: [24, 32],
// label style, only works in this data item.
label: {},
// item style, only works in this data item.
itemStyle:{}
},
[33, 31]
]
my data serie is setted like:
[[0, 0, 549], [0, 1, 571] ...
already tyried to change only the array with "653" in the midle follow those examples but without success...
I found a way to solve that
just add a new series with the value with i want to change the border
as my DataSerie is an array of arrays of lenght 62, just need to place the mean value in the second series:
DataSerie Example
[[0,0,1], [0,0,2], ... ]
ChartOptions = {
...
series: [
{
type: 'heatmap',
data: DataSerie
},
{
type: "heatmap",
// [ [x, y, value] ]
data: [ [DataSerie[31] ]
}
]
...
Related
How do I color each boxes individually in an echarts box-plot based on a function?
The following function works on a simple bar chart and colors the bars appropriately:
series: [{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
showBackground: true,
itemStyle: {
color: function(seriesIndex) {
return ProfessionColor[seriesIndex.name.split("_", 1).toString()]
},
},
}]
However, it does not work on a box-plot:
series: [{
name: 'boxplot',
type: 'boxplot',
datasetIndex: 1,
itemStyle: {
color: function(seriesIndex) {
return ProfessionColor[seriesIndex.name.split('_', 1)];
}
},
encode: {
tooltip: [1, 2, 3, 4, 5]
}
},
{
name: 'outlier',
type: 'scatter',
encode: {
x: 1,
y: 0
},
datasetIndex: 2
}
]
If I provide color: "red" rather than a function all boxes are colored red. This leads me to believe that it needs to happen in the transform.config which I can't find in the documents or tutorial.
Echarts Box-Plot currently
The link is the complete charts in its current form.
Apparently, echarts only allows scripting (i.e., using a function for) either the line color -- option itemStyle.borderColor or the fill color -- option itemStyle.color.
The difference between the two appears to be made by the value of the internal property BoxplotSeriesModel#visualDrawType. It is now set to "stroke", which means that borderColor can be set via a function.
Since you wanted to set the fill color, its value should be set to "fill". I searched a way to change that property - it was rather difficult for echarts don't document an API for extensions. Still, navigating the source code I came up with this hacky solution:
const BoxplotSeriesModel = echarts.ComponentModel.getClassesByMainType('series').find(cls=>cls.type==='series.boxplot');
const BoxplotSeriesModelFill = function(...args){
const _this = new BoxplotSeriesModel(...args);
_this.visualDrawType = 'fill';
return _this;
}
BoxplotSeriesModelFill.type = BoxplotSeriesModel.type;
echarts.ComponentModel.registerClass(BoxplotSeriesModelFill);
That's a "patch" to be applied at the beginning of your script, immediately after you have the echarts global defined.
Here's a forked version of your code that uses that patch. The only other change I made was to set a borderColor (can now only be a fixed value) to black.
This will not get you all the way, but if you add colorBy: "data" to your options and remove the itemStyle, it will look like this:
The pie is as shown below
is there a way to associate ace falling load to color say orange , 3 -point technique to green
tried with
Highcharts.setOptions({
colors: ['#F64A16', '#0ECDFD',]
});
this works fine on load if a user applies a filter some time ace falling load might not come then the color suffuses is there a way to tick the color to a value always in highchairs
please point to a sample
The easiest way to achieve that is by specifying each point's colour inside the series.data
series: [{
type: 'pie',
data: [{
name: 'Red',
y: 10,
color: '#ff0000'
}, {
name: 'Green',
y: 10,
color: '#00ff00'
}, {
name: 'Blue',
y: 10,
color: '#0000ff'
}]
}]
API Reference:
https://api.highcharts.com/highcharts/series.pie.data
Demo:
https://jsfiddle.net/BlackLabel/1sh5kp93/
I want to add echarts markpoint to chart for show specific events, as the figure below. I expect that I can add event on specific date. And when user hover event block(D), they can see tooltip about some details.
I tried to use echarts markpoint option to add event block, but I don't know how to get hover event to show tooltip. And I want to add event to specific data, but now I just can set it position by (x, y). Or Is there any way/option to solve my problem? Thank you!
markPoint: {
symbol: 'rect',
symbolSize: 15,
label: {
formatter: 'D',
},
itemStyle: {
color: 'rgba(70,78,86,.9)',
},
data: [
{ x: 70, y: 140 },
],
},
actual result
https://i.imgur.com/cE4HObG.png
expected result
https://i.imgur.com/UR2UBAO.png
Can any one suggest me the way of adding title to the C3.js line and bar charts ? I have got the following sample but it is for gauge chart. For any c3 chart is there any option to set the chart title?
donut: {
title: 'Title'
}
This was a top google result, so I thought I'd add that this is now part of the library:
title: {
text: 'My Title'
}
More info # https://github.com/masayuki0812/c3/pull/1025
You'd need to fall back to using D3 to add a chart title. Something like:
d3.select("svg").append("text")
.attr("x", 100 )
.attr("y", 50)
.style("text-anchor", "middle")
.text("Your chart title goes here");
I am using this code for my chart.
Code:
var chart = c3.generate({
data: {
columns: [
['Monday', 70],
['TuesDay', 20],
['Wednesday', 30],
['Thursday', 50],
['Friday', 100]
],
type: 'donut'
},
donut: {
title: "usage "
}
});
Result :
also couldn't find a way and ended up writing the title as the unit and editing the label.
gauge: {
label: {
format: function(value, ratio) {
return "%"+value;
},
show: true // to turn off the min/max labels.
},
min: 0,
max: 100,
units: "Overall Profit"
// width: 39 // for adjusting arc thickness
},
In my app users can add/remove as many series they want to the HighStock component using a piece of UI I wrote. However, when a user adds multiple time-series and the legend is under the chart, it shrinks the chart's height (in favor of the legend). This way the overall height remains constant.
However, I'm interested in having the plotting area keeping the same height and still have the legend be under it, changing the overall height if needed.
code
Here's a fiddle to demo the issue.
Ideas?
set maxHeight property. this will fix the maximum height of legend and gives navigation to legend.
maxHeight: 100,
here is the fiddle http://jsfiddle.net/9vZ8F/2/
instead if you remove
layout:'vertical'
legend will not occupy much space
here is a fiddle for it http://jsfiddle.net/9vZ8F/1/
Hope this is useful to you.
How about doing a calculation on the number of series you have and adjusting the chart height based on that?
var series = [{
name: 'series 1',
data: usdeur
}, {
name: 'series 2',
data: usdeur
}, {
name: 'series 3',
data: usdeur
}, {
name: 'series 4',
data: usdeur
}, {
name: 'series 5',
data: usdeur
}
],
height = 400 + (series.length * 15);
$('#container').highcharts('StockChart', {
chart: {
borderWidth: 2,
height: height
},
legend: {
enabled: true,
layout: 'vertical'
},
navigator: {
//top: 200
},
rangeSelector: {
selected: 1
},
series: series
});
http://jsfiddle.net/SSn4e/