score:2
score:0
have you tried putting a comma-separated list of values under xaxis:{ categories:[{'5/29/2007', '9/4/2007', '9/23/2008'}] }
and for the chart: { series: [{null}, {300}, {400}] }
i believe you can also use a delegate for the xaxis labels or series labels so that you can test the values against a threshold and drop them out.
score:3
you can do it easily with .islast
and .isfirst
, like this:
xaxis: {
type: 'datetime',
labels: {
formatter: function() {
if(this.islast || this.isfirst)
return [whatever label calculation you need];
else return null;
},
},
title: {
text: 'date'
}
}
score:3
old question, but there's now a cleaner way to do this with tickpositions
.
var chart = new highcharts.chart({
chart: {
renderto: 'container'
},
xaxis: {
type: 'datetime',
labels: {
// when using tickpositions, you'll also need to specify a label format.
format: '{value:%e. %b}',
},
tickpositions: [date.utc(2007,05,29), date.utc(2007,09,04)]
},
credits: {
enabled: false
},
series: [{
data: [
[date.utc(2007,05,29), 300], // this x-axis value should be labeled.
[date.utc(2007,09,03), 300], // no label for this value
[date.utc(2007,09,04), 200] // this x-axis value should be labeled.
]
}]
});
score:4
regarding the (1) question, i believe you can't do that in datetime xaxis in highcharts. when setting that type of axis, the framework calculates the ticks shown in the correspondent axis depending on the data you have.
in answer to the (2) question, i believe that so far you can't skip times in the datetime axis. however, and even though i haven't tried, you might want to look at some workaround using categories so you can use a formatter and replace the ticks that you don't want.
despite all of the above, i did a workaround that you might want to use and that it just needs a little bit of formatting to be more or less what you were asking. here it is:
var chart = new highcharts.chart({
chart: {
renderto: 'container'
},
xaxis: {
type: 'datetime',
labels: {
enabled: false
}
},
series: [{
datalabels: {
enabled:true,
formatter: function(){
if(this.point === this.series.data[this.series.data.length - 1])
{
return this.x
}
if(this.point === this.series.data[0])
{
return this.x
}
}
},
data: [
[date.utc(2007,05,29), 300],
[date.utc(2007,09,23), 300],
[date.utc(2007,09,04), 400]
]
}]
});
basically what i do is getting rid of the xaxis labels and just show the date in the point itself for the values that i want (first and last). notice that you might want to format how that date is shown because right now is showing the timestamp in ms.
you can see this live in jsfiddle: xaxis labels deleted
Source: stackoverflow.com
Related Query
- How to show only specific x-axis values on datetime axis in Highcharts
- How to show all values at datetime axis in highcharts?
- How To Show All Data Labels For Datetime Axis In Highcharts
- Show only two axis values in highcharts
- HIGHCHARTS - Given a series with UNIX stamps and values pairs for the data, how do I show only the date for the first and last point on xAxis?
- How to show equally spaced axis for datetime for billing cycle related data on highcharts
- How to show only integer values on yAxis of HighChart?
- Highcharts datetime axis, how to disable time part (show only dates)?
- Show specific series values in the stack label using highcharts
- how to pass values to tooltip which not in x and y axis in highcharts
- HighCharts scatter plot with Datetime on X Axis not plotting values correctly
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- how to show column and area charts with different y axis with same category and same x axis in highcharts
- How to make the Y Axis values not start from 0 in highcharts? How to display forcefully display the last category data on X axis in HighCharts ?
- How to show only one pair of linked Highcharts series at a time
- In highchart how to show y axis values in reverse order
- How to show values in Highcharts tooltip other than x and y when data points are too high?
- How to show specific point to show specific information in HighCharts
- How to display specific years only on xAxis in a column-graph with Highcharts
- How to show only the last 100 candlesticks or hide the first 50 candlesticks in Highcharts Stock Chart?
- Stacked Bar Highcharts how to show the values
- How to shift data using Series.addPoint without shifting x axis values in highcharts
- Highcharts - How show only two series on click
- How to show first and last label of x axis Highcharts
- Highcharts - How to show intermediate values on Area chart
- How to Show Same Month name of two years in X axis of Highcharts
- Highcharts how to only plot if x axis is having value greater than 0?
- How to spread Y Axis values in "area" chart using HighCharts
- How to properly configure DateTime axis for Highcharts on Android?
- How can I pull only specific columns \ cells from csv in <pre> tag, into highcharts pie chart
More Query from same tag
- Disable stretching time axis by additional tick (highcharts)
- Highcharts yAxis labels inside plot area and left padding
- Angular Highcharts dynamic x-axis not working
- Convert datetime to timestamp milliseconds adding +1 month
- setData is not a function + Angular2-Highcharts
- how to access function in Json
- How do I force highcharts to pay attention to min and max on my secondary axis?
- I want to show a 0% data without a column in stackbar chart in android using highchart
- Move dial numbers on gauge highchart?
- Custom colors in R highcharter barplot
- How to add Highcharts series automatically with a 2D-array?
- highmap : not able to display tooltip
- jQuery.HighchartTable custom tooltip
- Update chart border color with plotband color in angular gauge
- Day vs Time on Scatter plot
- Highcharts Angular Error 15 despite correctly ordered values
- Highcharts Point marker
- JavaScript Date converted to UTC on HighCharts
- Can I add an xAxis break dynamically based on live data feed
- Highcharts - Changing chart type
- Can we show the title hover over x axis/y axis text in highcharts dumbbell chart?
- xaxis range won't take chart's full width in area-colums combined chart
- Programmatically draw rect and line in Highcharts with zoom
- How do I move the title-label of a polar (spider) graph with HighChart 4?
- HighCharts Export Server not creating image
- HighCharts - Set default Axis options for my extension
- How do I put box-shadow to Bar(point) on hover of Highcharts?
- Javascript /jQuery Stock Chart API with multiple separate axis but combined interaction (pic included)?
- Decide which serie goes into range-selector highstock
- Updating chart on clicking button