Chart.js
it's straight to show gridlines https://jsfiddle.net/haingdc/bgarmz7k/14/
gridLines: {
lineWidth: 0,
}
So I need to display gridlines inside (or below) lines area like the below pic.
How can I hide gridlines outside?
Related
Example of Stacked Y-Axes
I can't figure out a way in Chart.js to get the Y-Axes to stack like I have in the example picture.
When I keep the scales object simple like this:
scales: {
y: {
stacked: true,
title: {
display: true,
text: "Temperature (°C)",
}
},
x: {
type: "time",
time: {
tooltipFormat: "LTS",
unit: "hour",
},
title: {
display: true,
text: "Datetime",
},
}
},
I obviously get a single Y-Axis, but instead of scaling to the maximum of any of the datasets, it seems to add each dataset up (ex: Say max Temp from any set is 40 °C, if I have 6 datasets the Y Scale goes from 0 - 250)
Additive Y-Axis example
It does stack all of the lines nicely though so I'm really hoping there is a decent solution as the Y-Axis right now is not helpful to a viewer. Thanks for any help!
With help from the Chart.js Slack channel, the easiest and actually great looking solution was just to separate each dataset into their own chart with only the top most chart showing a legend, and only the bottom chart showing an X-Axis. All middle charts have the X-Axis and legend turned off.
I want to get a line width of 10 on specific points in the chart.
I can get a line width of 10 but on all lines with the following code:
gridLines: {
display: true,
lineWidth: 10
},
Current chart:
Is it possible to add specific width on different gridlines
What i want:
Codepen:
https://codepen.io/flowwdelapro/pen/RwPMbvb
You have to use an array instead of a number.
lineWidth: [1,1,10,1,10]
The number are applied from left to right.
I'm trying to change the color of the black labels on the x-axis. Now they're black, which don't go well with the background. In the documentation I only found: rowLabelStyle or barLabelStyle. How can I change the color of the labels on the x-axis?
By using this CSS:
#timeline text {
fill: #dddada;
}
The text appears light.
By default, Google Chart positioned horizontal axis ticks on the border line of Chart Area, which can be shown in this picture:
How can I set some kind of padding to chart area that will make it look like this:
I am using Google Charts https://google-developers.appspot.com/chart/.
I finally found the answer:
Since I am using Date Data Type format, the chart will act as Continuous Chart (https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Data_Format).
Continuous Chart has characteristics of having tick close to the edge of the chart. What I have to do is set the domainAxis.type option to 'category'. https://google-developers.appspot.com/chart/interactive/docs/customizing_axes#Discrete_vs_Continuous
Here is the code of my chart using ChartKick (http://ankane.github.io/chartkick/):
<%= line_chart #daily_pageviews, library: { domainAxis: { type: "category" }, curveType: "none", height: "400px", colors: ["#ff9933"], chartArea: { backgroundColor: { stroke: "#ccc", strokeWidth: 1 } } } %>
Result:
Hi iam working on google chart it is displaying fine but i need the font size and color of the text displayed on X-axis and Y-axis coordines.Can any one tell how to do this one
Use the hAxis.textStyle.color and vAxis.textStyle.color` options to set the color of the axis labels.
Use the textStyleOption to set the color to labels.
hAxis: {
title: "Locations",
textStyle: {
color: 'black'
}
},