Hi Infragistics,
I'm trying to highlight some data in a bar or column series. I want a few of the columns to be highlighted, not just one category. In an ideal world, most of the columns would be semi-opaque, and the highlighted columns would not.
I'm populating my data from a view model, so the normal WPF way is to have an 'IsHighlighted' property in each data point view model, and use a data trigger in a style in Xaml. All very neat.
Not so, apparently. I've seen some horrendous workarounds on the forum for the people who come across this problem. The most likely solution was a few hundred lines of code.
Note, some have suggested I use a series for each column and set the opacity there. That doesn't work in my scenario because I'm also creating clustered and stacked charts.
Help!
Thanks
Pete
HI Peter,
I found a post that may help you resolve your issue:
http://ko.infragistics.com/community/forums/t/51834.aspx
Sincerely, Matt
Developer Support Engineer
Thanks Matt, I've seen that post before and others like it trying to solve roughly the same problem, and it really doesn't really help.
Your example shows how to change a style in response to mouse enter. This is not even close to my requirement. I have data points set from view models. I need to set the style programatically, whether it be mvvm or any other way.
I'm having to use code-behind already, just to use a dynamic number of series. I don't mind continuing like that, if I can only find a solution.
I also tried a data trigger in the implicit rectangle style, but you are not passing the data item through.
Highlighting data is the most simple and fundamental requirement in a chart. It's a shame if it's not possible.
thanks
HI,
You can create a style targeting the Rectangle and wire up the PreviewMouseLeftDownbutton.
The rectangle DataContext will have the data you.
You can change the opacity and probably set up a binding to the class(object) each column represents.
Sincerely,
Matt Developer Support Engineer
Matt,
Check your code.
DataContext dc = r.DataContext as Infragistics.Controls.Charts.DataContext; WeeklyTotals wt = dc.Item as WeeklyTotals;
wt is always null, because you are not passing the data item through. I can't tell what data context you mean, your sentence is unfinished, but there is no route through there back to any of my classes to bind to. The rectangle data context does not have the data we need.
If you can just show me how to 'probably' bind the rectangles, or the columns, to classes that represent them (including multiple series scenarios) then we will be home and dry. Then we can select / multiselect bars in a chart, and we'll be happy. I can do this in the code, and in single series, just can't show which bars are selected to the user in multiple series scenarios.
It's been a week now, and we still don't have a resolution, so we're probably going to have to decide against using your bar chart. Let's hope we don't find similar shortcomings in your other chart types. I'm looking at line charts next, and I think i have examples on selecting values there. It's a shame, because we have nine or so annual licences with you over various technologies. We would have ideally hoped for a path forward on this project that includes Infragistics.
We should submit a feature request for this issue.
I have another solution that will work as long as the columns of the chart are not scrolled in an out of view.
I making use of the Rectangle Loaded event. As each chart is loaded, I put an index number in the tag property.
Here is my sample.
MattDeveloper Support Engineer
thanks for your continued support.
We've found a temporary solution by altering the code in the ColumnSeries to popupate the data context with our data item, and then just using a binding in the implicit Rectangle style. I think you're right that we should submit a feature request, as we don't benefit from your unit tests or quality assurance if we change the code ourselves.
At least we can continue with our implementation.
Hi,
You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
There are many benefits to submitting a product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).
2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
3. Add your product idea and be sure to be specific and provide as much detail as possible. Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thank you for contacting Infragistics.
Matt
all ok thanks.
Hi ,
Please let me know if you need further assistance regarding this issue.