teechart


Vertical scrollbar for legend box


I'm using legend scrollbar tool in the teechart to show scrollbar for legend box. Now horizontal scroll bar is visible at bottom position but I'm looking for a way to display a vertical scrollbar for legend box which in some cases could contain more than 50 legend items.
thanks in advance.
Unfortunately, the legend scrollbar always is drawn in same position as legend alignment. But, you can prevent possible problems in the cases where legend is aligned to bottom and contains a lot of legend items using the property MaxNumRow. The code below shows you how can do that
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Dock = DockStyle.Fill;
Steema.TeeChart.Tools.LegendScrollBar sclenged = new Steema.TeeChart.Tools.LegendScrollBar(tChart1.Chart);
for ( int i=0; i<50; i++)
{
new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
tChart1[i].FillSampleValues(10);
}
tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
tChart1.Legend.MaxNumRows = 3;
}
Hoping this helps you
Thanks in advance
Regards
As described by Sandra, the TeeChart Legend places the scrollbar at the bottom of the Legend, horizontally, when aligned Top or Bottom of the Chart and on the right, vertically, when aligned to Left or Right. So an option for the vertical scroll is to position the Legend to the right of the Chart.
If you prefer the Legend at the bottom and you specifically require a vertical scrollbar, you can override the scrollbar location by custom setting the Legend position and dimensions. Note when overriding position, that the scrollbar horizontal or vertical behaviour will still respect the original Top/Bottom or Left/Right alignment of the Legend. Hence, for the Legend you want to achieve you can do something like this:
tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Right;
tChart1.Legend.CustomPosition = true; //Chart will now redimension, ignoring Legend location. Your responsibility now.
tChart1.Panel.MarginBottom = 35; //make room. This is % .. can set as pixels, see MarginUnits
tChart1.Legend.Left = tChart1.Axes.Left.Position; //lineup with Left Axis
tChart1.Legend.Top = tChart1.Axes.Bottom.Position + tChart1.Axes.Bottom.Labels.Font.Size + 20; //make Top relative to Chart bottom axis location
tChart1.Legend.AutoSize = false; //now set dimension you require
tChart1.Legend.Width = 130; //your settings
tChart1.Legend.Height = 70;
Downside is you’re not offered multiple columns with this approach (as the Legend still thinks it’s vertical); the previous suggestion (MaxNumRows on a bottom Legend) may still be more desirable.

Related Links

Teechart for Silverlight embedded
Borland Decision Cube Component will not load
How to get the data of the higher band and lower band of the Bollinger Band
Can't get TeeChart into VS2010
Exporting a teechart chart to stream
TeeChart package for silverlight 2010
Getting Error using Teechart for Mono for Android
TeeChart examples
Returning the y value of a drawline
Build Error for x64
Tchart Rectangle Tool
TChart Error series is not being displayed correctly
ClickSeries Event
Multiple charts with the same X Axis
NearestPoint does not work with points very close to axis
Export to PDF file

Categories

HOME
django
phpword
azure-stream-analytics
jpa
polymer
telegram
gpu
vscode-extensions
appcelerator
opendj
google-cloud-functions
entity-framework-core
carousel
hpc
zip
x264
mapbox
recordrtc
g++
fhir
gson
emoji
supervisor
endpoint
selenium-ide
scrolltop
capistrano3
modbus-tcp
scsi
aws-sdk
chargify
asp.net-mvc-viewmodel
visual-studio-extensions
event-store
dynamically-generated
draft-js-plugins
expressionengine3
beautifier
corpus
angular-translate
cppreference
gitlab-api
kodi
jett
reverse
sql-delete
yowsup
video-capture
python-pptx
lint
playframework-2.1
connection-pool
password-protection
recurrent-neural-network
comparison-operators
logback-groovy
drupal-theming
show-hide
memory-mapping
uiimage
phpdbg
jquery-ui-draggable
vugen
tf
azure-cli
sundials
seq
cmp
branch-prediction
pocketsphinx-android
testrail
stripe-connect
flex-monkey
ziparchive
microstation
segment-io
flex4.6
neon
simevents
appscale
directdraw
google-books
ons-api
phonertc
coda
sapscript
eoferror
zscript
matlab-deployment
android-broadcast
dot.js
infosphere-spl
big-ip
post-commit-hook
easyrtc
psr-4
malformedurlexception
winginx
tinyxml
paste
twitter-bootstrap-rails
synapse
sphinxql
scrypt
breakout
code-duplication
inputmismatchexception
rolify
kaleidoscope
android-icons
boost-msm
iboutlet
inkcanvas
predicatebuilder
fitbounds
wiimote
cross-database
cgimage
xcelsius
mysql-error-1205
lr
creole
tmx
django-paypal
blender-2.49
filesystemobject
interop-domino
windows-identity
escrow
soappy
information-management

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