How do I create a simple chart with a single horizontal bar. Xaxis is time and yaxis is one category named execution. I want to show a chart that shows a bar during the times when I have state executing and for states in between I want to display a blank in the same horizontal bar.
What you are looking for, I think, is a Gantt chart. Check out this example: http://jsfiddle.net/highcharts/KNGba/. It is a basic chart with just one element. Now check out this one: http://jsfiddle.net/highcharts/r6emu/. This shows you events during a time line.
Related
I have a dataset in google sheets that shows how often I do certain sports. I have created a stacked bar chart by month to follow the trend. I would like to use emojis to use as the data labels so that I don't need to have a legend. However I do not know how to change the data labels from being a count and to be customisable text?
For example for swimming I'd like it to show the emoji: 🏊 rather than "2" for jan, "4" for feb etc.
Is this possible?
It's not possible for stacked charts. It is for regular Charts, as you can see in this solution:
You can use emojis as labels by adding notes to the chart. You will have to copy the emojis from external sites and do the following steps:
In the column to the right of each data point, add your text notes (in this case, emojis).
Double-click the chart you want to add notes to.
At the right, click Setup.
In the box next to "X-axis," click More and then Add labels.
Enter the data range with your notes. For example, C1:C3.
Click OK.
In my case, the chart looks like this:
Since your Chart is stacked, this is not possible for this case. I recommend you to request this feature to Google by clicking on Help > Send feedback.
I am using the "Custom Events" highchart plugin by Black Label, to detect right click in my chart. My goal is to use the right click in the chart as "Back" button when drilling out from my custom data. I know highchart has drilling options embedded, but this is a highly custom application, and my problem is that I need a way to detect right click on the x-axis crosshair line.Since the crosshair is following the mouse, 90% percent of the right clicks is triggered on the crosshair line itself, and I can not manage to detect that click. I need the event to be catched inside highcharts, because there is multiple charts on my page, and I need to know which chart was clicked on, and on what point.
I hope you understand my explanation and problem.
BR,
Benjamin Kruger
I have a charts done in highcharts in which I show and hide series depending on a checkbox (if the user clicks on a checkbox and all series are shown, if he unchecks the checkbox, some series are hidden).
It is working great.
Now I have an issue with the legends in the chart: if the series are hidden and the users enables a legend, the segment of all series (hidden or not) are shown in the chart.
I would like to handle the click item so I only handle series that are being shown.
To do that, I created an eventhandler for the legendItemClick event.
Inside it, I am able to access the legend (using this) but I am only able to call functions in a legend level, affecting all series. Is there anyway I could get to a series level?
Thanks!
Edit: created a jsfiddle as an example: http://jsfiddle.net/JLkGm/1/
Steps to reproduce:
1- unmark the checkbox
2- click twice in john + joe
Note that the segment related to Jane + Janet will show up
I would like to prevent this segment from showing if the checkbox is not checked.
ps: sorry for the js code in the checkbox event handler, we are using coffeescript, the original code was this one
toggleCompareData: (toggle) ->
columnName = COLUMN_HIGHCHARTS_TOKEN + #secondaryPrefix
if toggle
for serie in #chart.series
serie.show() if serie.stackKey is columnName
else
for serie in #chart.series
serie.hide() if serie.stackKey is columnName
It looks like bug, reported to our developers here: https://github.com/highslide-software/highcharts.com/issues/3309
My chart is composed of multiple chart series. I have created a custom legend with buttons so the user can press a button and show or hide a chart series as desired. I have implemented a solution where the number of series are redefined after each button press but this requires a call to reloadData which is an expensive operation.
How do I hide a chart series without calling reloadData? I am looking for a solution that only requires the chart to be redrawn using redrawChart.
SChartSeries objects (from which all series types inherit) have a hidden property. You can set this property to NO or YES to show or hide the series. You must call redrawChart after changing the value.
For example, the following method toggles the visibility of the first series in a chart:
- (IBAction)handleTogglePressed:(id)sender {
SChartSeries *series = _chart.series[0];
series.hidden = !series.hidden;
[_chart redrawChart];
}
I'm looking for a way of controlling legend items through my custom button.
The button will be placed out of the canvas area.
How can I get a list of legend items, and toggle them through checkboxes?
By doing that, I can give users more spaces to see graphs.
Thanks,
Sung Am YANG
You can look at the legend item names using
chart.series[0].name
chart.series[1].name
To toggle axes on and off, use
chart.series[0].show()
chart.series[0].hide()
e.g. http://jsfiddle.net/BasRN/ shows hiding and showing the first series with buttons, including setting the button text to the series name.