Amcharts legend dynamic resizing - amcharts

I want my legend to adjust itslef according to the amount of data that is coming in like highcharts . For example if I have only one legend I don't wanna legend to take the length as the div itself and I also have multiple pods .if there are a lot of legends I want it to have scrollbar instead now it's reducing the size of the chart itself.
Pls give your valuable inputs .

You can have the Legend rendered inside a defined Element referring to it using divId.
Then just make sure your legend element is setup to use scrollbars.
Please check the example here: https://codepen.io/team/amcharts/pen/dac1c66de18a50661c8195d4b792a30c

Related

How to make a tooltip for a chart in d3?

We need to make it move like here.example The code is complex there, I can't figure it out.
I wrote the code my code, but I don’t understand how to make the tooltip move horizontally not behind the mouse, but near the nearest horizontal mark (as in the example)
It is not yet clear where the text above the bold text in the tooltip comes from. How to remove it so that it looks like in the picture?
How do I make the title of the tooltip match the label on the X-axis?
There are many ways to accomplish this. The way I typically do this is to create a series of SVG elements -- such as circles or rects -- using the same scale and data as the paths.
You can make these objects visible or invisible. Either way, you can attach mouseenter, mouseleave events to each to render and populate the tooltip.

dimple.js: Tool-tip placement in a chart of a nested svg element

I am trying to modify Bullet Charts example of dimple.js with each bullet chart being in a child-svg of the parent-svg. Purpose of having individual svg for each bullet chart is to make their management (show/hide/remove) easier. Also, this makes the recursive definition of a chart complete - That is, a chart is contained by an svg.
The fiddle for the modified version is here....
As you can see, from 2nd chart onwards, on mouse hover, tool tips go out of place!!! Please note that, for child-svg, I've set the style overflow: visible without which tool-tips were not visible at all.
Want to know if I am missing anything in handling the attributes of child-svg elements or is it a bug in dimple.js. Also, please let me know if you know of any workaround.
Thanks.
One of the first questions I have is why do you want child svg elements? What are you trying to accomplish?
The only difference I see in your code and the example is the height / width swap at the top and the sub svg + bounds.
Keep in mind that the origin changes with each sub-svg. This might be why you are having trouble with the tool-tips. Maybe you have that worked into your add-bullet calls.
I think nagu has the right approach here if you really want separate svg elements.

Trouble with positioning of nvd3 pie charts

I have two nvd3 pie charts in my page and when I try to position them with
the following code,only the first one is getting replaced. The second one seems to have no effect.
This is the code I used
d3.select(".nv-pieWrap")
.attr("transform", "translate(0,-35)");
This is taken in the first graph, but for the second pie chart,the positioning is not applied, when I checked with Firebug.
Please help me on this.
In order to select all pie charts on the page, you'll need to use d3.selectAll as follows
d3.selectAll(".nv-pieWrap")
.attr("transform", "translate(0,-35)");
According to d3 API reference:
A selection is an array of elements pulled from the current document.
...
...
After selecting elements, you apply operators to them to do stuff. These operators can get or set attributes, styles, properties, HTML and text content. Attribute values and such are specified as either constants or functions; the latter are evaluated for each element.
You can find more at https://github.com/mbostock/d3/wiki/Selections

nvd3 multibar chart show values

I have a stacked multiBarChart created with nvd3: jsfiddle is here: http://jsfiddle.net/e3kxZ/5/
(1) How can I get each region to display its value near its top?
I tried showValues(true) but I don't think that's supported in multiBarChart.
Other concerns I have are:
(2) how to set the text color so that it contrasts enough with the region (dark vs light colors), and
(3) how to keep the text labels from overlapping if any particular region is small.
I found an svg example (doesn't use nvd3) -- it assumes a static size for the chart, but I'd prefer to use something convenient and dynamic like nvd3.
Alternatively, if there is a different js library that supports this out of the box, please let me know and I'll use that instead.
Thanks in advance for any help!

Invert nvd3.js legend click function

So, in nvd3 charts, clicking on a legend entry basically filters that out of the chart window (for instance in the case of area charts). I want to invert this functionality..i.e. show the particular chart when its corresponding legend is shown and hide all the others...is there a way to do it?
It is similar to what happens when user hits the chart itself (i.e. only the one that is clicked is expanded and rest of the streams hide).
I am referring to this example: http://nvd3.org/ghpages/stackedArea.html
There's a radioButtonMode that should do exactly what you want. You should be able to set this on the chart, i.e.
chart.radioButtonMode(true);

Resources