how to get the value of the pie slice in fusion chart - fusioncharts

I'm new to FusionCharts.
I have generated a pie chart with slice, my question is:
When I click on the slice in the pie chart, I need the label name of the slice.
How can I write the on click event and get the name of label?

I don't much about charts and such, I'm fine using Word for this. But in 2D Graphics I've learned you can use
...contains(shape)
...intersects(shape)
To see if shapes are inside eachother (to contain) or if they overlap eachother (to intersect).
When adding a mouseListener, you can use
e.getX() and e.getY()
to get the current X and Y position of mouse on screen.
So something like
for (pieChartPieces p: piece)
{
if (pieChartShape.contains(e.getX, e.getY))
{
//* Some kind of notifier for user pops up here.
}
}

Check out this fiddle here
It uses "dataplotClick" event to retrieve the label of the pie slice.

You have to use link attribute, as seen here.
"link": "JavaScript:populate('411');",
See the jsFiddle.
Don't forget to implement the populate() with the whatever you need to do.
Link to a similar question (with answer).

Related

Display Syncfusion Chart TrackBall at top of Chart

We want to display our TrackBall label at the top of the Graph. We do not want to GroupAllPoints but that appears to be the only way to get the label to appear at the top of the graph.
When we do set LabelDisplayMode="GroupAllPoints" the label ignores the LabelTemplate we have set on the LineSeries. I assume that is because GroupAllPoints covers multiple Series.
How do set LabelDisplayMode to NearestPoint but display that label
at the top of the graph?
Alternatively how do I create a Template that does get picked up
when GroupAllPoints is set. Despite us only having a single point
to display in the TackBall. We'd only be doing this if there was no other way to get the trackball to display at the top of the graph.
Based on your requirement we have prepared a sample for your reference. In which we have achieved your requirement using the "annotation" property in the chart. Please find the below sample, code snippet, and screenshot.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AnnotationSample-1842581013.zip
Code Snippet:
<ejs-chart id="lineContainer" >
// add additional code here
<e-chart-annotations>
<e-chart-annotation Content="<div id=lineContainer_tooltip></div>" X="90%" Y="1%" CoordinateUnits='#Syncfusion.EJ2.Charts.Units.Pixel' region="Series"></e-chart-annotation>
</e-chart-annotations>
Screenshot:

How to mix bar and lines in Grafana in one chart

How can I display one dataseries as bar and another as a line in one graph like it is used in the last comment of: see last picture
Short answer:
It's not possible (yet) using the Grafana UI, only by hand.
Long answer:
As far as I know there is no way of doing this using the UI switches; you'll have to use the use the "alias or regex" fields below the visualisation configuration.
Prepare your data
Before you start, make sure that your queries A and B retrieve actual data. You won't see your data otherwise and be confused why they're not showing.
Adding fields and values to the aliases
Once you are selecting the correct data you want to display, just add the following on the visualisation section of the graph at the 'alias or regex' fields:
Add 2 overrides, one for each value you want to display using the 'Add series override' button.
Add a "Bars:false" option flag and a "Lines:true" for the value you want as a line.
Be sure to use the exact opposite values for your bars ("Bars:true" & "Lines:false")
Add a 'Y-axis: 2' to the value you want to have on the right side of your graph.
Optionally, you can add a "Z-index: 3" for the value that you want to have on top (I added this option to the line to make sure it's always drawing on top of the bars).
Enjoy
You should now have a nice graph with 2 types of data and visualisations in one; something like this:
For those who were asking in the comment section, yes this isn't available in version 8, however, you can still change the time series visualization to graph(old) so you can set the alias/regex.

dc.js chart.select function

I am new to dc.js. And I refer to the API Reference and see the chart.select function. But I do not know how to use it.
Such as I have a piechart and I want to have the value and percentage showing in the div below the chart. Could some one tell me if this can be realized using chart.select?
chart.select is for selecting some elements in the d3 or CSS selector sense, if you want to apply some attributes. It probably won't help you directly.
What you are probably looking for is the filtered event, which will tell you when items have been selected. Then you can read the filters and display them elsewhere like so:
chart.on('filtered.some_id', function() {
d3.select('#your-div').text(chart.filters().join(','));
});
(There are also ways to respond directly to interaction events, but I think this is more to the point for what you're trying to do.)

Google bar chart with difference arrow

Plain and simple, is it possible to do a bar chart like this one.. using google chart ?
I have no code to show you because is very simple to do bar chart but not sure if is possible to generate a difference arrow. (this graph is from Think Cell)
The closest thing I am aware of is Diff Charts. They aren't nearly as explicit in marking the change, but they are a way to visually display the change in a data set.
Using DiffCharts requires to separate google.visualization.DataTable instances with the old data an new data. You then call the computeDiff(oldData, newData) method on the chart instance and it will give you a new DataTable instance that you can use to draw the diff chart.

add shape dynamically to activereports

I've got a kinda requirement in which there is a kinda graph (static picture) on a page. In that picture I need to plot some points dynamically. That means using a shape filled with blue color. The number of points is floating depending upon the number of applicants choosen. How can I make it work or how can I add new elements to report at runtime. Am working in ASP.nET using VB and the AR version is 6.2
If I have understood your query right,then you want to plot some points depending on the dynamic data.
A suggestion would be to make use of Chart control in report. The chart can be bound to anything from a list to an array and the data can be changed dynamically from time to time.
Moreover,you can set the backcolor and other properties of the Chart control to give a look and feel of your choice.
Regards,
Mohita
Sorry if my question makes any confusion.. Actually I was able to make that. So am just sharing that code if it helpful for someone else.. I put this to the report start event. (We are not permitted to make this in details event)
Dim pic As New DataDynamics.ActiveReports.Picture
pic.Image = System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath(String.Format("~/images/circle.gif", cl)))
pic.SizeMode = SizeModes.Zoom
Detail1.Controls.Add(pic)