We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.5.1
https://codepen.io/Srikanth-Sangana/pen/pvzGmYa
Bar chart options : option = { title: { text: 'Bar Chart with VisualMap', left: 'center', }, tooltip: { trigger: 'axis', }, grid: { left: '10%', right: '10%', bottom: '15%', containLabel: true, }, xAxis: { type: 'category', data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], name: 'Month', }, yAxis: { type: 'value', name: 'Value', }, visualMap: { type: 'piecewise', show: true, position: 'top', orient: 'horizontal', scrollable: true, // Enables scrolling for many conditions itemWidth: 20, itemHeight: 16, pieces: [ { gt:50, color: '#FF0000'} ], calculable: true, textStyle: { fontSize: 12, color: '#000', }, height: 100, outOfRange: { color: '#00ACDD' } }, series: [ { name: 'Data', type: 'bar', data: [3, 12, 25, 45, 65, 78, 90, 101, 125, 145, 160, 175], itemStyle: { color: function (params) { let value = params.value; return value > 50 ? '#FF0000' : '#00ACDD'; } } } ] };
Line chart Options: option = { title: { text: 'Line Chart with VisualMap', left: 'center', }, tooltip: { trigger: 'axis', }, grid: { left: '10%', right: '10%', bottom: '15%', containLabel: true, }, xAxis: { type: 'category', boundaryGap: false, data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], name: 'Month', }, yAxis: { type: 'value', name: 'Value', }, visualMap: { type: 'piecewise', show: true, position: 'top', orient: 'horizontal', scrollable: true, // Enables scrolling for many conditions itemWidth: 20, itemHeight: 16, pieces: [ { gt:50, color: '#FF0000'} ], calculable: true, textStyle: { fontSize: 12, color: '#000', }, height: 100, outOfRange: { "color": "#00ACDD" } }, series: [ { name: 'Data', type: 'line', data: [3, 12, 25, 45, 65, 78, 90, 101, 125, 145, 160, 175], lineStyle: { width: 2, }, }, ], };
- OS: - Browser: - Framework:
No response
The text was updated successfully, but these errors were encountered:
duplicate of #18274 and others
Sorry, something went wrong.
No branches or pull requests
Version
5.5.1
Link to Minimal Reproduction
https://codepen.io/Srikanth-Sangana/pen/pvzGmYa
Steps to Reproduce
Bar chart options :
option = {
title: {
text: 'Bar Chart with VisualMap',
left: 'center',
},
tooltip: {
trigger: 'axis',
},
grid: {
left: '10%',
right: '10%',
bottom: '15%',
containLabel: true,
},
xAxis: {
type: 'category',
data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
name: 'Month',
},
yAxis: {
type: 'value',
name: 'Value',
},
visualMap: {
type: 'piecewise',
show: true,
position: 'top',
orient: 'horizontal',
scrollable: true, // Enables scrolling for many conditions
itemWidth: 20,
itemHeight: 16,
pieces: [
{ gt:50, color: '#FF0000'}
],
calculable: true,
textStyle: {
fontSize: 12,
color: '#000',
},
height: 100,
outOfRange: {
color: '#00ACDD'
}
},
series: [
{
name: 'Data',
type: 'bar',
data: [3, 12, 25, 45, 65, 78, 90, 101, 125, 145, 160, 175],
itemStyle: {
color: function (params) {
let value = params.value;
return value > 50 ? '#FF0000' : '#00ACDD';
}
}
}
]
};
Line chart Options:
option = {
title: {
text: 'Line Chart with VisualMap',
left: 'center',
},
tooltip: {
trigger: 'axis',
},
grid: {
left: '10%',
right: '10%',
bottom: '15%',
containLabel: true,
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
name: 'Month',
},
yAxis: {
type: 'value',
name: 'Value',
},
visualMap: {
type: 'piecewise',
show: true,
position: 'top',
orient: 'horizontal',
scrollable: true, // Enables scrolling for many conditions
itemWidth: 20,
itemHeight: 16,
pieces: [
{ gt:50, color: '#FF0000'}
],
calculable: true,
textStyle: {
fontSize: 12,
color: '#000',
},
height: 100,
outOfRange: {
"color": "#00ACDD"
}
},
series: [
{
name: 'Data',
type: 'line',
data: [3, 12, 25, 45, 65, 78, 90, 101, 125, 145, 160, 175],
lineStyle: {
width: 2,
},
},
],
};
Current Behavior
Expected Behavior
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: