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
angular-material
react-virtualized
lodash
rdf
electronics
ip
baqend
fancybox
networkx
synchronization
dacpac
spring-xd
row
rascal
handsontable
windows-phone-7
ups
decimal
percona
django-simple-history
workload-scheduler
django-admin
angular-ui
beyondcompare
lucene.net
reverse-proxy
paging
sylius
tibco-mdm
autosys
user-interaction
entitlements
fifo
compatibility
jspm
c++-amp
nouislider
galsim
caret
hybridauth
windows-dev-center
geopositioning
jmonkeyengine
swisscomdev
hue
broadcastreceiver
g-code
reportingservices-2005
modelmapper
acoustics
paxos
clean-architecture
powercli
fancybox-2
tizen-native-app
svmlight
kbuild
composite-key
sqlclient
qtwebview
akka-cluster
zendesk-app
lync-client-sdk
eventkit
specrun
fody
storekit
dlna
rtbkit
r-tree
tmuxinator
security-testing
deis
responsive-images
composite
angular-local-storage
graph-api-explorer
clipperlib
umbraco6
offloading
gulp-less
system.net.webexception
industrial
tidy
dataservice
jplaton
robotics-studio
referrer
twrequest
getmessage
joyent
self-extracting
krl
pyinotify
mysql-error-1005
floating
datareader
yslow
subviews
blitz++
paster
compiler-specific
backcolor
ctp4
mtj
xetex
thread-local-storage
uiq3

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App