Is there any way to set multiple colors in an axis title in google charts? Through the charts options or jQuery?
For instance, I have this graph:
I set the Orange Y-axis title to orange with {title:'Orange', minValue: 0, titleTextStyle:{color: 'orange'}}. I would like to set the other Y-axis title so that green is the color green and blue is the color blue. Seems simple but is it possible?
You can just fix it like this:
hAxis: {title: 'Date de Prélévement',titleTextStyle:{color: '#FFF'}, textStyle: {color: '#FFF' , fontSize: 10} },
vAxis: {title: 'Heures de sommeil',titleTextStyle:{color: '#FFF'}, textStyle: {color: '#FFF' , fontSize: 10} },
Related
I am trying to reverse the axis in a chart,what i want is to have to line of the chart running from left to right and the date.now() from right to left? How can i accomplish that?
I have tried to do x: {
reverse: true
},
y:{
reverse: false
}
Actually, you can reverse to arrays. In addition, depending on the situation, You can add new items in reverse.
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'].reverse(),
data: [65, 59, 80, 81, 56, 55, 40].reverse(),
I'm trying to generate a chart of my NDVI values, but I'm getting this error:
Error generating chart: Computation timed out.
This is my code..any help-advice would be really helpful!!
It's important to mention that my AOI file contains more than 500 polygons, that have been converted to a multipolygon..I don't know if this is a problem..
Thanks a lot!
\\Select the ndvi from an Image Collection
var selectNDVI_2020 = getNDVI_2020.select(['NDVI']);
\\Plots NDVI
var plot_index= ui.Chart.image.seriesByRegion(selectNDVI_2020, aoi, ee.Reducer.median(),'NDVI',5000,'system:time_start','system:index')
.setChartType('LineChart').setOptions({
title: 'Δείκτης NDVI για ' + metavliti +' για το έτος 2020',
hAxis: {title: 'Date'},
vAxis: {title: 'NDVI'},
viewWindow : {max : 1, min : 0},
colors: ['blue'],
curveType:'function',
pointSize: 4
});
print(plot_index,'NDVI_2020');
Maybe the AOI is too large for computing.
I change my parameter "scale" from 30 to 300, and find that it was okay.
Can i create line graph which is the data get from previous page. I have done a calculation on my previous page. I would like to create line graph using the result and times. I face the problem to adjust the coding below because the coding below show the data was fix.
series: <LineSeries<SalesData, String>>[
LineSeries<SalesData, String>(
dataSource: <SalesData>[
SalesData('Jan', 35),
SalesData('Feb', 28),
SalesData('Mar', 34),
SalesData('Apr', 32),
SalesData('May', 40)
],
In Laravel 5.6 / vuejs 2.5 application I use vue-chartjs, but my charts looks like :
https://imgur.com/a/ru1dXlm
I want some more:
having several items(artists in my case) I want to see them half-transparent, just as in first example here http://demo.vue-chartjs.org/
having points with values shown as in first example at link above
I need to see all labels in x-direction( I fill labels parameter ) for here
If there source code of demo examples of link above > I searched and did not find...
Thanks!
Well, you should find everything you need in the documentation of chart.js and vue-chart.js
http://www.chartjs.org/docs/latest/
http://vue-chartjs.org/#/home?id=resources
You can add rgb values as a background color to make them transparent.
You can also use gradients as its just a canvas element.
Here is a tutorial:
https://hackernoon.com/creating-stunning-charts-with-vue-js-and-chart-js-28af584adc0a?source=user_profile---------5----------------
Here is the source code of the vue-chartjs demo page:
https://github.com/apertureless/vue-chartjs-demo
(It's a bit outdated as with v3 the creation of chart components changed a bit)
It seems you did not filled the labels correctly.
{
labels: ['Here', 'are', 'your', 'x-axis', 'labels'],
datasets: [
{
label: 'artist 1',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
data: [0, 1, 2, 3, 4],
},
{
label: 'artist 2',
backgroundColor: 'rgba(255, 99, 132, 0.2)',
data: [0, 1, 2, 3, 4],
},
],
}
Suppose I have a data file with x y z column, which looks like:
-3.063052922487259 -3.141592741012573 401.3000000000000
-3.063052922487259 -3.063052922487259 1.290000000000000
-3.063052922487259 -2.984513103961945 0.920000000000000
-2.984513103961945 -3.141592741012573 0.100000000000000
-2.984513103961945 -3.063052922487259 10.80000000000000
-2.984513103961945 -2.984513103961945 1001.290000000000
-2.905973285436630 -2.984513103961945 514.4000000000000
-2.905973285436630 -2.905973285436630 131.0300000000000
-2.905973285436630 -2.827433466911316 129.3300000000000
The range of the values within the z column will define the color of the data points. For example, on the z column, if the value is between 0.0 and 0.3, the color of data points will be set as blue; if between 0.3 and 1, the color of data points will be set as orange; if between 400 and 1000, the color of data points will be set as navy.
So I write some code like this:
set xrange [0:15]
set yrange [0:-15]
set zrange [0:1400]
set cbrange [0.001:1400]
set palette defined ( 0 "goldenrod", 0.3 "blue", 1 "orange", 2 "cyan", 4 "yellow", 10 "green", 20 "pink", 50 'gold', 100 'purple', 400 'navy', 1000 "red")
set palette maxcolors 11
unset key
unset surface
splot "DATA.dat" using 1:2:3 with image
Which does not work. Any help?
Further update:
I really want to explain clearer why does not work, but Stack Overflow does not allow me to further explain, because they require me to have 10 reputation points in order to post an image result. So I can not post my result due to lacking of reputation. But I do modify my data set, so you can see the xy-data is equidistance now.
So I just describe the problem by words, instead of image, which is that the color box is wrong. According to my code, between 400 and 1000 should be navy (just one color). But the color box on the image shows that between 400 and 1000, there are 5 different navy colors, from shallow navy to deep navy. How can I only have one navy color between 400 and 1000 please?
The maxcolors option doesn't work properly in your case because it only discretizes the underlying color gradient. You can use the test palette command to see how your actual palette looks like:
set palette defined ( 0 "goldenrod", 0.3 "blue", 1 "orange", 2 "cyan", 4 "yellow", 10 "green", 20 "pink", 50 'gold', 100 'purple', 400 'navy', 1000 "red")
set palette maxcolors 11
test palette
You must also keep in mind, that the numbers used in the palette definition aren't absolute values on the cb-axis, but the values (in your case from 0 to 1000) are mapped to the actual cbrange (0.001 to 1400).
In order to get regions with constant color value, you do the following:
set palette defined (0 "goldenrod", \
0 "blue", 0.3 "blue", \
0.3 "orange", 1 "orange", \
1 "cyan", 2 "cyan", \
2 "yellow", 4 "yellow", \
4 "green", 10 "green", \
10 "pink", 20 "pink", \
20 "gold", 50 "gold", \
50 "purple", 400 "purple", \
400 "navy", 1000 "navy", \
1000 "red", 1400 "red")
test palette