score:0
I ran into an issue with the answers above when using an exported class using react/typescript. The "this" that was getting into the function was the "this" for the class and not the expected one.
To solve that, I had to move the function outside of my exported class. Here is an example.
export class MyClass extends React.Component<MyClassProps,any> {
drawChart() {
const options = {
...
series: [{
...
dataLabels: {
...
formatter: formatter
}
}]
}
...
}
}
function formatter() {
if (this.y != 0) //My use case was different, so I used this.point.value
return this.y;
}
score:9
Here is the answer, by how short your question is i am not full sue if the existing answers are correct.
In highcharts 0 is considered a number so it will render it on charts. But null is hidden. So when you are adding data, you have to check if the value is 0 and if it is, then change it to null.
Let me know if you have questions.
Fiddle: http://jsfiddle.net/8kr0tods/ See that may is a 0 and mar is null, and null is hidden.
if($VAL==0)
{
$VAL='null';
}
score:13
You can use datalabels formatter and add condition which check if value is bigger than zero.
plotOptions: {
series: {
dataLabels:{
enabled:true,
formatter:function(){
if(this.y > 0)
return this.y;
}
}
}
},
http://api.highcharts.com/highcharts#plotOptions.column.dataLabels.formatter
score:33
You can use the formatter. Something like this should do it:
dataLabels: {
formatter:function() {
if(this.y != 0) {
return this.y;
}
}
}
http://api.highcharts.com/highcharts#plotOptions.series.dataLabels.formatter
Source: stackoverflow.com
Related Query
- How to hide zero values in Column chart
- How to show a column with the value Zero in Column chart in Highcharts?
- Hide 0 values in Stacked Column Chart in Highcharts
- How to hide intermediate values of solid gauge chart of highcharts?
- Hide the zero values in a Scatter/Column chart in highcharts
- How to show a column with the value Zero in Bar chart in Highcharts?
- How to hide 0 values in multi chart in highcharts?
- How do I hide the code for the chart data in highcharts?
- How to create a column range chart in Highcharts using range and navigator functions?
- how to hide highchart x - axis data values
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- High chart - Column Range Chart with Time range. How to get tooltip as Start and End time
- Highcharts -- Hide zero values without using 'null'
- How to dynamically add point placement and point padding in fixed column chart (highcharts)
- How to hide empty column in column hightcharts with multiple series
- How to format my json data for stack column chart in HighCharts
- How to add a horizontal line in Column bar chart in Highcharts plugin?
- hide a particular column on xAxis highchart Column Chart
- How to Build a Column Chart in Highcharts with Data Entered Dynamically Within a CMS
- how to change color of line chart in highchart based on a categorical column in r?
- Hide datalabels inside stacked column chart if we have 1 data
- How to show Legends for all the series data in stacked column chart Highcharts?
- How to set border in column chart - Highchart
- how to dynamically change column chart to mirror chart using highchart
- How to change tooltip of a column chart programmatically in highchart
- how to add new index Highcharts column drilldown chart
- How to use linear-gradient to column chart in highchart.js
- Highcharts pie chart hide zero sector
- Column Chart Show datalabel for null values - Highcharts
- How to hide only the columns of this group when hovering over a group column in highcharts?
More Query from same tag
- Highcharts: Disabling/Enabling enableMouseTracking after initial render
- Charting with 500K data points
- How to display last data point value in a tag on Y Axis in line chart of highChartjs
- Highcharts.js combined bar/line chart with timespan bars
- Stacked, grouped column chart with variable width of x points
- Highcharts Line Chart - Hyperlink on a data point
- HighChart legend I override mouseover but loose transparency functionality. How do I keep it?
- Accessing another list in the dataLabels.formatter function in Highcharts
- How can I show last 10 indexes in Highcharts Timeline and left using scroll?
- Putting the data in the designated date in highcharts
- Unable to pass the value between components using props in react?
- How can I pull only specific columns \ cells from csv in <pre> tag, into highcharts pie chart
- Spline chart drawn on the xaxis in case of single value or constant values - highchart
- Parsing JSON data for Highcharts
- How to pass time in "highcharts"?
- How to use scrollbar on highcharts heatmap?
- Making tooltip behave like in scatter
- I need Highchart watermark image when i download highchart
- ECharts how to set different symbol for different marklines in one chart
- React-highcharts: how do I stop the chart from re-animating when a certain prop changes?
- Only show integer steps on axis
- How to set border for a highcharts pie?
- Get only visible x axis dates when zooming in highcharts
- Use Highcharts in Android
- highcharts additional title opinion
- Display informations under the X-Axis like in Excel with Highcharts
- Highcharts Sparkline in reactjs without Jquery
- Highcharts heatmap column width based on content size
- highcharts-export-server with highcharts-regression plugin in a node module throws an error
- Using modified JS version in Highcharts to bring back the pre-3.0 export buttons