I am using amcharts to draw bar chart. I need a chart title in my chart.
So I put graph title my code as follows:
graph.title="Beer chart";
But title is not coming.
Check my fiddle : FIDDLE
You added a title for your graph. To add title to the whole chart, use titles array (for JSON-based config), or addTitle() method for object-based. (you seem to be using the latter).
I.e.:
chart.addTitle("Beer chart");
Here's your fiddle updated as per above:
http://jsfiddle.net/baffygje/1/
Related
Is there a way to use a different shape for the milestone markers in Highcharts Gantt? I'd like to use triangles instead of the default diamonds.
If a solution for this involves using the API to change something in the chart after the chart is loaded and telling it to redraw (instead of doing something with the configuration options), I'm fine with that.
As you can see in the Highcharts Gantt source code: https://github.com/highcharts/highcharts/blob/47dfb49f7b6053178c92d24b34b5f3e7ddd8770b/ts/Series/Gantt/GanttSeries.ts#L202
shape for milestone can not be set through API options.
The simplest solution is to replace diamond function with the built in triangle function.
(function(H) {
H.Renderer.prototype.symbols.diamond = H.Renderer.prototype.symbols.triangle
})(Highcharts);
Live demo: https://jsfiddle.net/BlackLabel/9zuodLjt/
Docs: https://www.highcharts.com/docs/extending-highcharts/extending-highcharts
I am working with Dygraph in python. I want to remove a label from the legend. If you look into the example photo attached bellow you can see "A:2.77 B:2.29". Is it possible to remove the B label, but still use its values and to be displayed in the graph?
Currenlty, in my project self.page().runJavaScript(f'g.updateOptions({{file:{file},labels:{labels}}});') is getting the calculated labels and their values and displaying them. However, if I go and remove part of it , it will be removed from the graph as well.
self.exampleCalculated.emit({'Price (Next 2 days)': example_forecast['price1'][0:48], 'SystemPrice': systemPrice[0:48], 'Other': otherPrice[0:48]})
Example
I want to add a point in value ex: 800000 become 800.000 when the pointer is near the bar chart
This is an example chart that I made:
here is the documentation on making a tooltip in chart.js:
https://www.chartjs.org/docs/latest/configuration/tooltip.html
you can add functions to tooltips.callbacks to calculate the title, data etc displayed in the tooltip. Then, with JavaScript's NumberFormat https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat you ought to be able to achieve the look you want.
The goal is to create a pie chart, where
the percentages (calculated or manually specified) are shown inside the pie.
data is shown upon mousehover.
Clarification: e.g. imagine a set consisting of 2 data labels. One is called apples (containing "15" apples), and the other one is called pears (containing "15" pears), then the percentages, always visible, shown inside the pie would be "50%" and "50%", whereas the data shown on mousehover would be "15" and "15".
Such has been already done in a previous post: Displaying percentage inside pie item for highcharts with JSFiddle 1.
However, would it be possible to
use a semi-circle donut pie chart, instead of a circle pie chart. (what is a semi-circle donut pie chart? -> JSFiddle 2)?
have text labels (data names) on the chart inside the pie chart, such as in Fiddle 2.
*Clarification: e.g. having the data labels "apples" and "pears" on the pie by default, such as "Firefox" and "Chrome" in Fiddle 2.*
Any help would be greatly appreciated, as I find it hard to combine these Fiddles, since I am far underexperienced with JS.
E.g. Fiddle 1 works/starts with $(function () {
var chart = new Highcharts.Chart({,
whereas Fiddle 2 starts with $(function () {
$('#container').highcharts({.
The Highcharts API Reference manual is learning me slowly, as a beginner.
Since I'm not sure which you prefer here is a fiddle you can look at that leverage the highcharts formatter attribute:
formatter: function() {
return Math.round(this.percentage*100)/100 + ' %';
}
I believe what you want is something like this.
I have a bar chart that created in dc.js and hosted in jsfiddle. i want to remove x labels of this chart . after searching i find this SF question. but even i set
.xAxis().ticks(0)
it doesn't work and i can see the label.so how can i remove the xAxis labels.
Use the .tickValues() function instead, passing an empty array:
.xAxis().tickValues([]);
Complete demo here.