Did anyone resolve this issue in ng-charts 2 - angular5

https://github.com/valor-software/ng2-charts/issues/835
I have a multi Axis chart and one I click on some point I get all active points per this value. I am using the chartClick event as per the documentation.
For example: I have 4 lines. For year 2000 I click on the point of the first line. But I get an array of active points that contains 4 active points.
I want to know on which of the active points I have clicked, and not get all the 4. Or to get just the specific active point I have clicked on instead of array of all four.
How it can be done?

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

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)

Not understanding control removal from panel

I have a panel with about six controls on the panel. I wanted to remove the controls from the panel and finally did so with MyPanel.Clear(). But before that I tried the following code that runs from a button click:
For Each b As Control In MyItem.MyPanel.Controls
MyItem.MyPanel.Controls.Remove(b)
Next
I would click the button and watch it, as well as the MyItem.MyPanel.Controls.Count in debug. As it went through, the count would reduce: to 5 to 4 to 3, then it would exit. If I clicked the button again it would remove two more, then the last one on the third click, so they all fit the bill and were all removed without changing anything. Why did it take three clicks? I'm obviously missing something simple here, I think, but I don't know what it is, and I'd really like to understand it. If I had to remove specific controls, it looks like I would have had a problem.
I ran into this issue myself and its odd it even lets you do it as you're modifying the collection in the loop you are referring to.This should be a better method.
If you like to remove them based on type
For i = Panel1.Controls.Count - 1 To 0 Step -1
If TypeOf Panel1.Controls(i) Is Label Then
Panel1.Controls.Remove(Panel1.Controls(i))
End If
Next
Odd that VB.NET even lets you do this, but essentially what you are doing is editing the collection you are iterating through. To better understand, pretend you are using a regular for loop from 1 to 6, at the first iteration you are removing object 1, leaving you with 5 objects, making the old number 2 object the first. The next iteration you remove the 2nd thing, which used to be the third, and so on. Most languages this is a run-time error.
What is happening is that you are deleting the controls starting from the first position and moving to the last. If the list has 6 records and you start deleting them like you are, programatically you are saying:
remove(0)
remove(1)
...
remove(5)
While you are doing that, the list is getting smaller. Once you delete the first item it drops from 6 positions to 5, then 4, then 3, etc. So midway through your code it tries to remove item at location 3 (4th item), but since you already removed 3 items, the list's size only contains 3 items and that position does not exist.
To properly remove them all, you would have to start at the back of the list and move to the front.
Perhaps something like:
For i As Integer = (MyItem.MyPanel.Controls.Count- 1) To 0 Step -1
MyItem.mypanel.Controls(i).Dispose()
Next

How to get specific cell content in wxListCtrl

As the title said, can anyone give me a simple example how to get a specific cell's content in wxListCtrl.
For example, I build a wxListCtrl list, there may be 3 columns. When I Right click or Double click on one row, then it should popup a message box to give me the content in third column of this selected row?
Use wxListCtrl::GetItemText() to retrieve the contents of a cell.

Reporting Services Pie Chart

The pie chart is driving me nuts...Excuse me if I sound ignorant but I have figured out the other RS charts with relative ease, and this is the first time I have had to use the Reporting Services pie chart.
I have a dataset:
Columns:
ChildId int
AssessmentType varchar
Score int
All I want is to have a pie chart that displays the percent of the whole for each assessment type. So if I had 10 records returned with the following:
2 "THIS" Assessment Types
5 "THAT" Assessment Types
3 "THEOTHER" Assessment Types
I would want the pie chart to show that the "THIS" Assessment peice of the pie is 20%, the "THAT" is 50%, "THEOTHER" as 30%, but I cannot figure out how to set it up. Can any one help me out on this, or refer me somewhere. I have been looking for some time and can't find any pages that have helped me with this control.
I figured this out...To show the percentage:
Right click on the chart and click on properties.
Go the the Data table, select your "[Value]" and click edit.
Go to the Point Labels tab and check "Show point labels".
In the format code enter P
Edit the expression and calculate your percentage. In my example I would use the code below.
=Count(Fields!ChildId.Value) / Count(Fields!Childid.Value, "MyDataset")
The problem I was having is that I was filtering the data set at the chart level with a filter expression. So when I was trying to calculate the percentage using the code below my numbers were getting thrown off. The filter is not applied the dataset count when retrieved like I was doing it.
Count(Fields!Childid.Value, "MyDataset")