scichart


SciChart - show hierarchical list in axis legend


I have data seris that are grouped hierarchically. I need the chart legend to reflect this structure (see screenshot)
Switching off a group should naturally switch off all its child axes.
Is it possible to do this with the built in axis legend? If so, could you provide some pointers as to how? (because presently I don't have the faintest idea)
If not, what would be the best workaround? Disable the legend, implement a custom control, and then dynamically change the SeriesSource bound property?
The SciChartLegend control is simply an ItemsControl which displays data by binding to an ObservableCollection of SeriesInfo via the LegendModifier.LegendData property.
In English, what that means is, if you can figure out how to display a hierarchical group in an ItemsControl then you can do the same in the SciChart Legend control.
What you may need to do is to create your own class inheriting from ItemsControl to bind to LegendModifier.LegendData and group the items as you wish. Or, use an attached behaviour or converter to group items.
Next, you can use your own class or ItemsControl (instead of SciChartLegend) using the technique in the LegendModifier Documentation.
Alternatively – Binding LegendModifier.LegendData to SciChartLegend
You can alternatively bind LegendModifier.LegendData to a SciChartLegend and place anywhere in your application. You can also bind to an LegendModifier.LegendData to an ItemsControl.ItemsSource and template it as you wish.
<!-- Somewhere else in your application, you can declare n ItemsControl -->
<!-- and bind to LegendModifier.LegendData -->
<ItemsControl
Margin="23,23"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
<!-- Here you may need a converter or attached behaviour to group the SeriesInfo as you wish -->
ItemsSource="{Binding LegendData.SeriesInfo, ElementName=legendModifier, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<!-- Here you may need a Hierachical Data Template to display hierachical data -->
<DataTemplate x:Key="SciChartLegendItemTemplate" DataType="chartData:SeriesInfo">
<StackPanel Orientation="Horizontal">
<CheckBox Margin="5,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay}"
Visibility="Visible" />
<r:PointMarker Width="40"
Height="10"
Margin="5,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
DataContext="{Binding RenderableSeries}"
DeferredContent="{Binding LegendMarkerTemplate}"
Visibility="{Binding ShowSeriesMarkers, RelativeSource={RelativeSource AncestorType=visuals:SciChartLegend}, Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock Margin="5,0,5,0"
HorizontalAlignment="Left"
Text="{Binding SeriesName}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
While something like this is not a complete solution, it does show you how to use the SciChart Legend API to substitute an ItemsControl and template legend items. From that hopefully you should be able to group the items and display data in a hierachical way.

Related Links

Custom Label Provider: Can't override Init() method
SciChart went Maximum Plaid after updating to latest version
Limit for zooming out in SciChart
Two scicharts bound to the same SeriesSource, not updating
SciChart - legend marker not displayed in custom chart legend
Crashes loading surface when deployed on non-development machine
Draw Text under some angle with specific font
SciChart - LineArrowAnnotation not disappearing when visibility is set to false
Show Tooltip on top of Axis and Scroll bar
SciChart - showing labels for all ticks
Swap scroll bar and X axis labels
Rendering chart to bitmap in memory from IRenderableSeriesViewModel
SciChart - show hierarchical list in axis legend
SciChart - Accurate placement of rotated axis labels
SciChart ITickProvder.Init method is never called

Categories

HOME
omnet++
oracle11g
heroku
pycharm
iterator
relay
cvs
survey
gps
disassembler
angular-ui-bootstrap
blueprintjs
azure-storage-tables
swagger-ui
elasticsearch-hadoop
cloudkit
gorm
metatrader4
offline
circuit
caml
worldwind
windows-7-x64
google-static-maps
oracle-coherence
nodatime
accessor
dcevm
wijmo
dxf
angular2-aot
buildbot
status
windows-error-reporting
publish
dbclient
google-cloud-nl
file-rename
madlib
instant-messaging
functor
titanium-mobile
contact-form
openoffice.org
mapbox-gl
hexo
bower-install
main
dynamics-crm-2013
code-search-engine
graphenedb
sas-jmp
errordocument
worksheet
python-webbrowser
setter
tactic
imanage
gnome-shell-extensions
eventkit
firmata
spring-android
ctest
firebaseui
holder.js
python-stackless
hover-over
whois
goose
cloudbees
uid
eclipse-clp
wordml
fouc
security-testing
dukescript
cakephp-3.1
createprocessasuser
operator-precedence
oxwall
applescript-objc
flask-cors
page-layout
apc
cos
sharp-repository
http-unit
delphi-6
path-separator
armcc
nsmanagedobject
postgresql-performance
php-parser
genshi
django-tagging
pyinotify
icanhaz.js
gin
castle-monorail
javap
virtual-functions
yagni
rtml
ntvdm.exe

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App