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
Or maybe I could use mutliple category highlight layers. They almost suit my requirement, if I can highlight more than one category, and I can set which categories are highlighted programatically?
I'm going to have to keep throwing development days at this, because it's a blocking issue for us here. We can get it to work in a chart that displays a single series, using help from this post:
http://ko.infragistics.com/community/forums/t/51914.aspx
When we are showing multiple series on the same chart, we are struggling to bind the rectangle to the item source of the correct series.
HI,
I am attaching a sample that allows you to select a marker.
Please review my sample. LeftClick on a marker to select it.
Sincerely,
Matt
Thanks Matt,
I've had a look at your sample, thanks. It sets the colour of a marker on mouse click. There are a few reasons why only being able to change the look in response to a mouse event is not a solution.
The use case is that users can select data from a multi-series bar chart by clicking on a bar. They can left click to select a single bar, or multi-select using ctrl+click. This is all working perfectly, except I've no way to change the look of the bar to show it's selected / deselected.
You're approach is problematic because there's no way I'm going to put a marker on the top of each bar just to show a selection. Non-data ink should be minimised, and it's a bit nasty looking. Also, there's a problem showing the other bars have been deselected in a single select scenario. It needs to react to changes in the data.
This should be a data trigger in a style, ten lines of xaml, and not three developer days and counting. I'm not stuck in mvvm though, I've already derived a new chart from XamDataChart to add support for a dynamic number of series. I'm open to any way this is possible to achieve.
The StyleBinder approach we've seen in other posts works for me in a single series, but not for multiple series.
Last night I thought I'd cracked it using your custom bindable infostrips example. I was hoping to show a selection using a faint vertical infostrip. Again, this worked fine for single series column charts, but couldn't be used to show the selection of a single column in a multi-series chart.
To avoid duplication, this is CAS-121153-V7K0Q3
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.
Matt Developer Support Engineer
all ok thanks.
Hi ,
Please let me know if you need further assistance regarding this issue.
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,
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.
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