score:2
it is kinda possible. this code here produces:
it is not pretty code though.
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
- Opening a Column chart after clinking on DRILLEDOWN PIE Charts in dotnet highcharts
- Highcharts Export Server - Getting a blank chart
- Highcharts - no telemetric timeline chart
- Highcharts: Disconnect line when there's no data for position
- Coloured scatter-plots with javascript
- Highcharts: Custom area outline for line joining each marker
- Highchart - Export data as Excel file
- How to set a different border line of every single point or serie in Highcharts scatter plot?
- Highcharts Gantt avoid tooltip closure when moving cursor outside Gantt
- HighChart Graph not displaying in Mail
- Highcharts export module: Multiple Phantom JS instance in jBoss
- Dotnethighcharts library
- R Highcharter hcaes- Area chart staking by only 1 factor... with 2 grouping factors
- how can i add in highcharts a different dashStyle just for a part of the graph
- Highcharts: Is it possible to plot sunburst chart with no data values?
- Restrict mouseover area for a column to its own shape vs. surrounding area
- When i scroll Gnatt highcharts some of the data is not shown in some columns
- Multi Color dataLabel in Bar Highchart
- Highcharts - How to populate date with Mysql and PHP?
- Highmaps limit zoom range breaks zooming out
- HighcharteR multiple tooltips open with hideDelay
- How to use existing SVG symbols (in a file) as markers in highcharts?
- How to offset HighCharts data?
- HighStock: data series missing when zoom to larger range
- Highcharts datetime starting on wrong day
- Two y Axis in Highcharter in R
- Highmaps country map not showing when using type: "mappoint"
- JQuery animation doesn't work in IE8
- Using HTML with Vue or how to adapt it to Vue.js
- highstock ie8 error