d3 add line to chart, issue with cover line - d3.js

I'm using nvd3 to draw a chart, But I need to add middle line manually.
I use the lib's axis to translate a 'g' to draw the middle line, but the lines for y-axis 'cut' the vertical red line as the below, so can it set css like 'z-index' to above the line?

Related

Is there a way to add a label to a <Line> in Recharts, but not on every datapoint?

We have a LineChart in Recharts, and want to add labels to the lines themselves, but noticed that the label attribute of applies the label to every single datapoint of the line instead of just to the line itself.
Is there a way to add a label to the entire line similar to how reference line works?

D3 line chart highlight specific linepath

I'm using nvd3 to plot a line graph. As part of customization, is there a way to highlight a specific line path as in below image on top of B4. Any tips are welcomed.
Cloning the existing path and customizing the path d attribute, stoke-width, color did the job.

NVD3 line chart - legend text cut off

I'm pretty new to D3 and NVD3. I'm playing with the line chart example which works great except for one thing: it cuts of the legend text as shown in the screen shot below. In the picture, it says "Mean Size Distributi..." instead for writing out Distribution.
Going through the source for NVD3s legend module, I can't seem to find a setter for the legend width. Any ideas?
chart.legend.maxKeyLength(100);
This will set maximum text length of legend as 100.

Applying stroke-dasharray style to only part of a path

I have a run-of-the-mill nvd3 line chart. Sometimes the data represented by the chart is patchy. I would like to be able to style part of the lines differently to represent this, such as in this example:
Here, the dots are joined by a dashed line when far apart and a full line when close together. Is it possible to apply stroke-dasharray only to certain parts of a path, or do I have to trick nvd3 into creating a new line for each segment where the styling changes?
You can't apply stroke dasharray to part of a path, but you can create a very long stroke dash array that equals the length of your path and carefully calculate the locations of the dashes in JavaScript so that the dashes line up with the part of your path that you would like dashed.

How to Change Legend Type in Excel?

I have a line chart, where the chart legend also in forms of line. Is there a way I can change the legend type from colored line to colored circle or square?
Figure like this. http://www.nevron.com/gallery/FullGalleries/chartActiveX/stackline/images/StackLine1.png
I don't think you can use this method to get circles, but if you want to get squares, you can change the chart to a 3-D line chart, then right-click the chart area and select '3-D Rotation'. Change everything in the Rotation section of the menu to as close to 0 as you can get it. This will make your chart show up as a regular line chart while the legend shows little cubes. After you've done that, though, you'll probably have to change the axis settings. In my experience, 3D charts tend to show too many gridlines.

Resources