nvd3 - how to set y axis to default values - d3.js

I tho this was a pretty common requirement for a chart library, but I couldn't figure out how to achieve this.
I have a multichart(bars,area and lines) which displays time on the x-axis and temperature on the y-axis.
My max temperature across all the data series I've got is 22, and so my y-axis goes from 0 to 22. Can I make it to be ALWAYS from 0 to 100?
I tried with:
forceY = [0,100]
yAxis1.domain([0,100])
But all I get is from 0 to my max.
Suggestions?
thanks

Give yDomain1:[0,100]
working plunk here

Related

Dual Y Axis in line chart (dc.js)

Is it possible to add a line for the total sum regardless of shiptype with right Y Axis showing total values something like in image
I have checked this question, but there was no answer there.
Here is working example on codesandbox

faster way for setting up xticks using matplotlib

I am working on a project which make use of Python-2.7, pygtk and matplotlib-2 on windows.
My app records data from COM port and plot it like a live plot. I need to put major and minor ticks for grid purpose.
My X-axis data is time duration in seconds.
ax1.set_xticks(np.arange(x_range[0],x_range[1],0.45))
ax1.set_xticks(np.arange(x_range[0],x_range[1],0.09),minor=True)
major ticks # 0.45 sec.
minor ticks # 0.09 sec
x_range[0] is minimum value of x axis data
x_range1 is maximum value of x axis data
Setting ticks this way is taking more time and also it takes lot of time when I plot entire data.
Is there any faster way to set ticks using matplotlib?
Note: I have totally 7 different data sets to be plotted on different subplots.
Sample plot image is given blow.
In following image, you can see grid properly. This plot window is also with a scroll bar at bottom. Total plot size depends on total time of data recording.

How do i get the graph to draw a line for constant 0 values using amcharts?

I'm showing network throughput and disk io's in a graph.
But when there is no activity. 0 get's reported.
The balloon shows me 0 but the line is not being drawn.
it looks like the grid is on top but if I turn the grid off the line still isn't there.
if I make line-thickness 2, I can see it but then the line changes thickness between 0 value and non 0 value. from 1px to 2 px.
i can't find anything in the documentation about this.
Any clue?
Unfortunately this is a limitation with the library as it doesn't draw lines outside of the plot area so the line will be clipped at the edges as you've noticed. Setting the lineThickness to a larger number like you already did along with setting the valueAxis' zeroGridAlpha property to zero will improve it slightly, but your best bet is setting a small negative minimum in your valueAxis so that the zero line is clearly visible. You can combine this with setting showFirstLabel to false to hide the first negative value in your axis.
Demo

Dimple JS - Removing gap between the y-axis and the chart

I am using dimple.v2.3.0 to create line and area chart. When creating chart with category x-axis, Dimple leaves a gap between the y-axis and the line/area. I would like to ask is there any way to remove the gap?
I'm afraid there isn't a good answer for this, it's done this way because dimple allows you to combine with bars etc. There is a time axis for dates which will not include the gap and therefore answers the majority of cases with area charts, however categorical axes will always have the gap.
There is a hacky workaround you can use in this case where you have integers on your x axis which is to treat them as dates and put them on a time axis:
var x = myChart.addTimeAxis("x", "Call", "%Y", "%-Y");
x.timePeriod = d3.timeYear;
x.timeInterval = 1;
This will parse and display your calls as years and display them on the time axis. The "%-Y" display format shows a 4 digit year with no leading zeroes. This will work for integers up to 9999. Here it is working in your fiddle:
https://jsfiddle.net/zuuaar1t/

Limit on Y-Axis Value in Chart

This may not be an option currently for the Kendo Charts, however, I want to set a limit on the max value displayed on the chart. The chart I am displaying gives the user the option to select fixed y-axis at 100% or auto y-axis. The information being displayed is CPU usage so it's absolute maximum value is 100%.
The problem: I have found that if I use auto y-axis (don't provide a max y-value) then when the data hits 100% the chart will display up to 120% because of the 20% step size.
My current fix: I check the max value in the returned data during the chart render event. If the max value is >= 80% then I set the y-axis max to 100% so it doesn't display 120%. Then I redraw the chart.
Is there a better way to do this so I don't have to redraw the chart? I didn't have this problem with other charting libraries.
Thanks
Is valueAxis.max setting that you need ?
I ended up moving the code to update the max y-value from onRender to onDataBound. This way still feels kind of "hacky", but it ended up causing only one chart render event instead of two.

Resources