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

Bad Summ of 2 series (different sizes)
Vertical scrollbar for legend box
Error loading type library/DLL (TeeChart.TChart.10)
Show TeeChart on local Report
Need to evaluate TeeChartNET2015EVAL_4.1.2015.12166.exe with Framework 3.5
How to Cause Bars to Overlap in VCL TeeChart
We would like to draw a line at maximum value on a chart
Steema teechart html5 Javazript change view area
Javascript teechart - set min or max not working?
javascript teechart area series top border
TFastLineSeries class not found error in TeeChart Standard 2014 RAD XE5?
TeeChart showing abnormal message box and accumulating memory
Reset Marks in Line Series Teechart
TeeChart TLegendScrollBar visual issue when clicking on scroll-arrow
PERL, Tkx and TeeChart
How to install class derived from TeeChart?

Categories

HOME
notepad++
embedded
assembly
localization
linkedin
pda
twig
toolbox
pdfbox
google-cloud-functions
carousel
lanczos
pega
why3
speech-synthesis
radgridview
favicon
dynatrace
eip
dynamic-sql
identity-management
postscript
object-storage
perlbrew
custom-post-type
jquery-multiselect
comparable
mobx
kudu
autolisp
clickjacking
vue-chartjs
z-notation
protein-database
tasm
ogc
lpsolve
outputcache
android-exoplayer
signal-strength
term
semantic-logging
filenet
grails-plugin
google-cloud-console
uicolor
mongodb-php
jquery-jscrollpane
simevents
riot
nss
grgit
file-move
toolkit
finalbuilder
zscript
haskell-warp
uvc
diff3
cryptographichashfunction
rapidsvn
nodelist
iiop
sip-server
metatrader5
machine-instruction
cbind
angular-carousel
ignite-ui
maven-scm
http-patch
mysql-error-1044
printdialog
kogrid
neos-server
cmmi
route-provider
traceability
zope.interface
apache-whirr
jdb
predicatebuilder
urlrewriter
tournament
cdonts
timertask
silverlight-oob
cardspace

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