Google Charts not displaying correctly - google-visualization

I am generating a URL that needs to create a PNG Graph, using Google Charts API.
I thought that I had all the parameters in the right position however the graph is not displaying correctly? It is only displaying one of the series, and even then, the series data is wrong.
If anyone can point me in the right direction, it would be much appreciated!
http://chart.apis.google.com/chart?
cht=lc&chs=800x350& // CHART SIZE
chco=6a6572,6a6572,6a6572,6a6572& // SERIES COLOURS
chxr=1,-11519.670000,19297.010000& // Y AXIS RANGE
chxt=x,y& // X & Y AXIS
chxl=0:|January%2017|February%2017|March%2017|April%2017|May%2017& // X AXIS VALUES
chdl=A|B|C|D& // SERIES NAMES
chtt=Sales+Year+To+DateYYYY& // CHART TITLE
chts=000000,24& // CHART COLOR AND FONT SIZE
chd=t:6032,13921,0,1263,19297|-1330,-11520,-4410,490,-361|298,798,285,228,108|884,1651,1161,1473,961
// SERIES VALUES

I finally figured it out. For some reason the series values parameters were taking a percentage value? So once I converted the values to a percentage of the total, it displayed fine.

Related

chartjs unlimited x axis labels

i have a chart that fills itself with values, however currently i am limited on how many values i can display by the amount of label values i insert.
$scope.AxirsLabels = [1,2,3,4,5,6,7,8,9,10];
for example with the above label value i can only display 10 different values on the chart.
is it possible to set an unlimited amount of values based on the values of data?
each data value is an integer like 10 or 20 etc.
everytime the user clicks a button values are added to the data of the chart and the X axis needs to adjust.
Fixed it by using the function i use for adding data to the chart for the label values as well. this adds label values based on the amount of data values there are.
$scope.AxirsLabels = getDataProp('values');

Chart.js - different height for X & Y axis?

I have a dynamic chart where using filters, data either comes in or leaves the chart.
Some of my X axis labels are pretty....... long. :) Mostly they fit within the 400px chart but the ones that are very long don't and get truncated.
So currently I have solved that by simply adjusting the chart height itself, so that it fits pretty much any X axis label no matter how short or long it is.
But I've noticed, that with the height change the overall height of the bars (well, the height of everything that's above the X axis labels) also changed, so this means that if a user adds a content to the chart which has a long X axis label, they will get this content in, however the rest of the content that's already in there will visually increase its size.
Is it possible to set a different height for the main part of the chart and for the X axis labels?
Thanks.

Chart.js place y value position and its x-label position relative to the x-value

Is it possible for me to supply a chart.js chart with a list of Y values that have a corresponding label/X value and place them vertically and horizontally relative to their own value.
For example: I have a list of values at a certain time (unix timestamp) that I want to show on a chart, with its Y value positioned relative, but also its horizontal position and its label relative on the x-scale.
At this moment it always spaces out my labels, completely over the entire x axis, at equal distances, without taking into account the values of the labels itself. Is there way to automatically accomplish this with chart.js ?
A line or scatter chart will do the job. The main criteria is that the data is a series of x and y coordinates. Each point in the array is in the form:
{
x: xValue,
y: yValue
}
See http://www.chartjs.org/samples/latest/charts/scatter/basic.html
here is a jsfiddle that reproduces your image.

Not able to change the axes position qtxlsx

I have generated an Excel chart using Qtxlsx ,and i want to invert the axes from (Left/buttom) to (right/top) but i can't find the functions to change there positions.
Here is the code
Chart *lineChart = xlsx.insertChart(23,3, QSize(600, 400));
lineChart->setChartType(Chart::CT_Line);
lineChart->addSeries(CellRange("A4:A9"));

generalized formula for automating 2D line graph view port using glOrtho

Based on the dynamic data, I need to draw a 2D line graph dynamically using openGL. Since, the data varies, the final drawing of the graph also needs to be adjusted such that both X-axis's and Y-axis's max and min values should be viewed. I tried several ways using glortho, could any one suggest me the formula for this,
My x-axis max value is 10,000.0f and Y-axis max value is 64,468.0f
(assume x-axis n y-axis min val are around 1.0f)
glOrtho(-0.0,Winwidth,0.0,Winheight,0.0f,1.0f);
if I use above parameters I'm unable to view max and min values of the graph
glOrtho(-1.0f,maxXval,1.0,maxYval,0.0f,1.0f);
the above one works fine when max values are large,
what if the maxvalues are less then 1 for the above example, then the viewing area is being clipped because left value is 1 and similarly, bottom value is 1?
How about
glOrtho(minXvalue, maxXvalue, minYvalue, maxYvalue, -1, 1);