dojox.charting Setting Custom Tooltip Labels from ItemFileReadStore - dojo

I discovered that the dojox.charting.action2d.Tooltip takes a custom function to provide the text for the labels. The challenge is that the text of the label that I want to display is contained within dojo.data.ItemFileReadStore which the chart series is pointed at. I am trying to figure out some way to tie back the information passed in the object in the function to an item in the store. My understanding is that the notification object can contain the following:
event - a raw event object
type - can be "onmouseover", "onmouseout", "onclick" or "onplotreset"
run - a Series object
plot - a Plot2D object
index - the numeric index into series
element - can be "bar", "column", "circle", "slice", "marker"
shape - a dojox.gfx shape object for the element
hAxis - a horizontal axis object or null
vAxis - a vertical axis object or null
x - an x value (on the horizontal axis)
y - a y value (on the vertical axis)
cx, cy - a center of the marker/circle/slice in geometric coordinates
cr - a radius of circle/slice in geometric coordinates
I trued to access run.store, which seemed logical to me, but I get back undefined. y contains the particular value that I am chasing after, but I can't use that to search the ItemFileReadStore because I cannot guarantee that that would be unique. Ideally I am looking for some way of identifying specifically the item in the store that the current notification is being fired for.

http://docs.dojocampus.org/dojox/charting/ says that default text function looks for a custom tooltip text in 'Tooltip' property of the data point object. I would try to rename the store's items' property that holds label into 'Tooltip'.

Related

How to reposition non reliative multiple labels of edges in JGraphX

In a graph, I have edges that have more than one label (multi labels): one label is beside the source cell and another one beside the target cell. Both labels are created as child vertices of the edge. For correct positioning adjustement reasons, these labels do not have their geometry set relative (to the edge). When generating the edges, labels are correctly positionned: I use the mxGraphView.getPerimeterPoint() and an few adjustements to position the source and target labels.
When moving a cell using the mouse drag, I need to reposition these labels. For the moment I have tried to react to graph events (mxEvent.CELLS_MOVED, mxEvent.MOVE_CELLS) or model events (mxEvent.CHANGE) registering either a graph or a model listener.
However, the getPerimeterPoint function uses an mxCellState (not an mxCell) obtained through the graphView (graph.getView().getState(cell)) to do the calculation and this cell state mxGeometry is based on the previous position of the cell.
Is this solution based on events the correct way of doing this?
And if yes, should I rewrite completely the getPerimeterPoint (and functions used in it) to use the mxCell returned by the event (event.getProperties("cells")) whose greometry is correct rather than the mxCellState? Or is there a technique to get the cell state corresponding to the end of the current move operation without messing up the whole graph update process?
Any help or advice appreciated, thanks.

Can you force a label on top of a bar chart in SQL Server Reporting Services?

I would like to ensure the labels of my bar chart are above the bars. Can you force a label on top of a bar chart in SQL Server Reporting Services? If so, how?
The issues are the colors are so dark, it's hard to read them if they are not above the bar in the chart. I could just change the colors, but I'd rather learn how to force the label location if possible.
I'd like all numbers to be above the bar, like over the blue bar below. I have over 100 different charts in my report, so the scale will vary greatly depending on the particular report.
Thank you!
In Visual Studio, design mode, ensure that the properties window is visible, then click on any of the labels on the chart.
At this point, the properties window should show the properties for Chart Series Label.
Find the 'Position' property, which probably is showing the value 'Auto', change this value to 'Top' and this should do the trick.
You have to first make sure the chart type is not stacked.
In my experience the "Position" property doesn't always work.
Sometimes you have to go to the properties of the series, then "Custom Attributes", then "Label Style" then select "Top".
What #niktrs said in the comments of the other answer about setting the AllowOutsidePlotArea property is also true.
Microsoft do not use the label Position property for some of the chart types.
They tell us what they use by default here - in your case "on bar charts labels are placed outside of the bars that represent data points" (they appear to mean "column charts")...but sometimes with a large value it's placed just inside, sometimes partially in-out (and if you try the "Outside" position it just fails to render!).
As #jayvee has mentioned the trick with Column charts is to select the value and change the SmartLabels AllowOutSidePlotArea to True (from Partial).
However if you have a Stacked Bar chart then labels are always in the centre of the particular value.
The hack to get labels on top is to add an extra Stacked Bar value with the Color set to "No Color" and move it to the top of the values (using the Chart Data designer arrows).
The trick is getting a good expression value to use - a constant ends up too big or too small at some point, so I found a percentage of the stacked values works best (remembering to change Nulls to Zeros)...25% to 30% usually works.
Then set the value Label to the value you want to display in the data label.
I just had this issue, I was able to fix it by making sure the chart series "Smart Labels" - "Disabled" property was set to "True"
This is what my properties pane looks like:

Create custom labels under a graph

I've got different series in my project that I'd like to show in my graph. N element of each series are related to one "parent element", and we've got M parent elements to show up. I'm trying to underline this relationship creating a "label" under the x-axis.
Here is what I am trying to do
The Red,Yellow And Blue are the 3 series I'd wish create and as you can see they could have a different amount of point related to the "item". The label I'm trying to create is the one under x axis.
I'm trying to understand how to dynamically create a "label" or "customlabel" item with a simple border propriety under the x-axis. The related code should allow me to set up the initial value and last one, but I'm unable to setup the border.
Dim myLabel As New DataVisualization.Charting.CustomLabel
myLabel.FromPosition = 0
myLabel.ToPosition = 5

Labview : Changing color of boolean array, respectively

I made this boolean array.
I want change the color of first boolean component as red, and second as blue.
This picture is what I want.
But when I change color property, three booleans change their color with together.
Is there any way to change color of boolean components, respectively?
Short answer: Just replace the boolean with a color box, as shown in the links in the other reply. It will simply be an array of color boxes instead of an array of booleans.
Long answer: An Array control contains an inner element control. The only property that can differ between elements of the array is the Value property. All other properties are rendered identically across elements of the array. If you need to differentiate the elements based on something other than the Value, you need to either use a different control that renders the graphical aspect that you want as its Value (i.e. replacing the Boolean with a Color Box) or you need to break out the N elements that you want to display as N separate independent controls and manage the updating of the display by yourself through code on the block diagram. This generally means creating your own scrollbar control or numeric control for controlling the index of the array.
You can always try to change your approach a little, try using clusters and if you need to use array, then create array of clusters. Here and here are similar subjects that should help you solving the problem with colors.

vb.net return actual chart x and y values on mousemove

In my simple vb.net chart that displays a particular series, I would like to obtain running values of the actual values in the chart. I can already obtain the x-y coordinates, which is easy (e.x and e.y) - but wondering if there is a available method to convert the coordinates to the values related to the chart itself.
I need to use the mousemove event rather than mousedown.
I wish to transfer these actual values to a textbox on the form.
Thanks - burnt out trying to figure this out on my own.
This is pretty easy, unless the chart control doesn't give you some crucial information, in which case it's pretty hard :)
Your chart control probably shows several elements: the chart itself (bounded by the X and Y axes), the chart title, the axis titles, maybe a legend, etc. What you need to know is the .Left and .Width values of your X-axis. Assuming you can obtain those, the formula you want is
actualX = (mouseX - axis.Left) / axis.Width * (axis.Max - axis.Min) + axis.Min
Without knowing what chart control you're using on which platform, it's hard to tell you how to find all those pieces, but the formula is what you're looking for.