Create custom labels under a graph - vb.net

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

Related

Is there a way to display a different graph only when you select a graph variable?

first, i wanna show only pie graph.
and only if i select one of the pie graph fragments, I'd like to show the corresponding bar graph value.
Is there a way?
In QlikView
Open the chart preferences
Add the calculation condition = GetSelectedCount(FieldName) = 1 (More about GetSelectedCount function)
Open Error Messages
Select Calculation condition unfulfilled
Enter the message. It can be a plain text or expression/calculation
Now if nothing is selected in Director field (or more than one value is selected) the error message will be shown
If only one value is selected then the chart will be calculated
In Qlik Sense
In the chart properties expand Data handling and add the condition in Calculation condition and the message in Displayed message (as in QV the message can be plain text or calculation)
Nothing is selected (or more than one is selected) and the message is shown
Only one value is selected and the chart is calculated

Catia Create project using XYZ component as direction inputs

i want to create HybridshapeProject from the given 2D points of a sketch
the project is creating like this refer below image
as you can see in the image the projects direction is created based on XYZ components of the selected vertex from the sketch
i have to get the components with VBA Code that i dont know
any help how to create HYbridshapeproject like this
the XYZ values in Direction Window those i need to get from selecting the axis system and the sketch which is present in the axis system
In order to use components as direction in a projection, you have to set the property .normal to false and assign a value to the .direction property.
In the following example, I assume that the HybridShapeFactory (HSF) and the inputs for the projection (refProjectedElement, refProjectionSupport) has been declared:
Dim ProjectFeature As HybridShapeProject
Set ProjectFeature = HSF.AddNewProject(refProjectedElement, refProjectionSupport)
ProjectFeature.Normal = False
Dim ProjectionDirection As HybridShapeDirection
Set ProjectionDirection = HSF.AddNewDirectionByCoord(0#, 0.95, 0.05)
ProjectFeature.Direction = ProjectionDirection
The macro recorder should be able to deliver code for the projection along components.

Match two trellis pages between two different graphs

I want to have on the same page a pie chart and a bar chart, with trellis pages.
They both have 5 columns as trellis, so 5 different pages that you can visualize by scrolling down.
However, I would like to display the same pages at the same time for both graphs. For instance, let's imagine I'm on the pie chart, I scroll down one page - and so my pie chart is on page2 - I want my bar chart to automatically go to page 2 as well
I tried to use markings but although it links a bit the two graphs, it doesn't change the trellis pages automatically
Does anyone know how to do this ?
as #scsimon mentions, there's no native feature (nor API method, AFAIK) for this using a trellis. however, you can create a Property Control (I'd use a dropdown) in a Text Area, then use the same Document Property to your chart in a Limit By expression.
little more detail, assuming a data table like this:
A B CATEGORY
1 2 red
3 4 red
5 6 green
7 8 green
9 10 blue
11 12 blue
add a Text Area to the page and edit its contents
add a Property Control
click New to create a Document Property, give it a type String and a name category
change Set property value through to Unique values in column and choose the "category" column and click OK
save the Text Area contents
in your Pie Chart's Properties dialog, go to the Data page and look for Limit data using expression. click Edit
set the expression to: [CATEGORY] = "${category}" (don't forget the quotes or the Document Property won't be treated as a string and you'll get an error)
repeat steps 6 & 7 for your other chart
As #scsimon mentioned in the comments, it seems to be impossible. I found a way to have a similar representation though without using trellis visualization, by using text arena
I created a list box that contains the 5 columns I want to visualize, and then I select this list box as the vertical axis variable of the bar chart and the sector size of the pie chart
Then, by clicking on my list box, I can have a synchronized Pie chart and Bar chart (a bit different from what I expected but it also has some advantages like a multiple scale since a new graph is generated independently of the other variables)

Update Dynamically created text box by name withought looping through all controls (VB)

I have a project that creates several buttons dynamically along with a slider (two splitters in a panel).
For the purpose of this lets call the slider "slider9001" and the label "label9001". Each set of control's last 4 digits are different.
Currently I'm looping through all of the controls and looking for a label with the last 4 digits of the slider. This seems incredibly inefficient, especially considering there will be over 100 labels and 40-50 sliders on the form.
Does anyone know of a simple and more efficient way of accessing a dynamically created label
I should mention the slider will be used to update the label
If you know the name of the control you can get a reference to it
Dim lbl as label =
ctype(me. Controls("label9001"),label)
As the labels are generated, store a reference to each one in a dictionary. Use the digits as the key. When you need a label, simply retrieve it from the dictionary. The same approach will work for the sliders as well.
dim labels as new Dictionary(of string, Label)
' add generated labels to dictionary
dim lbl = labels("9001")
Outstanding! Since I already know the name
Dim lbl as label = ctype(me. Controls("label9001"),label)
Worked perfectly. Thanks Much!!!

dojox.charting Setting Custom Tooltip Labels from ItemFileReadStore

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'.