Angled label white space and start of label cut off.
Posted: Thu Mar 09, 2017 4:39 pm
Hello,
Is there anything we can do about:
The Blue rectangle shows the cut of of the label on the left of the panel.
Is there anything we can do about:
- Angled labels causing a large amount of white space under the chart
- Beginning of long angled labels being cut off.
The Blue rectangle shows the cut of of the label on the left of the panel.
- Make a new form.
- Add a TChart.
- Add a trackbar.
- Add the code below.
The code I used is:Code: Select all
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Steema.TeeChart; namespace NoRefreshOnHorizBar { public partial class Form1 : Form { private const string LONG_TEXT_STRING = "aBcDe FgHiJkL MnOpQrS tUvWx Yz"; // private Steema.TeeChart.Styles.Bar TheSeries; private Steema.TeeChart.Styles.Bar TheSeries; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { SetupTrackBar(); SetupChart(); } private void SetupTrackBar() { trackBar1.Minimum = 1; trackBar1.Maximum = LONG_TEXT_STRING.Length; trackBar1.Value = 1; } private void SetupChart() { tChart1.Aspect.View3D = false; tChart1.Legend.Visible = false; tChart1.Axes.Bottom.Labels.Angle = 30; tChart1.Axes.Bottom.Labels.Separation = 0; tChart1.Axes.Bottom.FixedLabelSize = false; TheSeries = new Steema.TeeChart.Styles.Bar(); for (int ii = 0; ii < 10; ii++) { TheSeries.Add(ii, LONG_TEXT_STRING.Substring(0, trackBar1.Value)); } tChart1.Series.Add(TheSeries); TheSeries.Marks.Visible = false; ResetLabels(); } private void ResetLabels() { if (TheSeries == null) return; for (int jj = 0; jj < TheSeries.Labels.Count; jj++) { TheSeries.Labels[jj] = LONG_TEXT_STRING.Substring(0,trackBar1.Value); } tChart1.Refresh(); } private void trackBar1_Scroll(object sender, EventArgs e) { ResetLabels(); } } }