in dc.js line chart ,when all y value is zero corresponding to the x axis value line is not drawing. it just displying xaxis and y-axis without ticks.Is it possible to draw line on the x axis with corresponding y value as 0 with x-axis name(field name)?
Related
In line chart point for(0,0),(0,4)....etc .I mean x value as 0 and y value as 0 or x value as 0 and y value as some other number and vice-verse is not working. How to solve this using dc or d3.js.
I have tried this link https://dc-js.github.io/dc.js/examples/line.html but I didn't find any solution.
I have a multi axis chart. I would like to display each Y Axis label below the Y-Axis values. Is this possible in Kendo?
I'm using d3js v5, with an Ordinal scale for my X axis on a line chart.
this.x = scaleOrdinal()
.domain(axisXDataTruncated.labels)
.range(axisXDataTruncated.range);
When I draw my x axis using this:
this.root
.append('g')
.attr('class', 'x axis')
.attr('transform', `translate(0, ${this.height})`)
.call(
axisBottom(this.x).tickFormat((data: string | number) =>
formatter(
this.graphDataMerged.lineChartOptions.axis.x.format,
data,
this.graphDataMerged.lineChartOptions.axis.x.currency
)
)
);
I'm using string labels (['Week 1'. 'Week 2',... 'Week 26'] as labels.
When I have a long number of labels, the x axis, discards the last labels and crops to a certain value. For example, with 26 values. Tha last label shows as 25, which is shown at the very end of the x axis.
Because the dots and lines of my chart includes the value at position 26, the axis and the dots don't match.
If I expand the browser's width, the last value of the x axis magically appears.
What could I be doing wrong? Is it a bug in v5?
How to show the y-axis and values in top of each bars using pentaho cde charts.
PFA.
I am plotting a y axis which should be defined in log scale. The range is from 0 to 1000.
If I try,
var yScale = d3.scale.log().domain([0, 1000]).range([height, 0]);
d3.svg.axis().scale(yScale).orient("left");
Then only 0.01 is shown in the y axis. According to the d3 documentation, log scale range cannot have zero.
I tried this https://stackoverflow.com/a/13228478/690567, but using the scale in the axis throws error.
Is there any other way plot this range (0 to 1000) in y axis?