I'm working with some sampleseriesmarkers. When I work with standard windows tooltips, it handles the \t, and it looks great, and handles it well.
When I add the \t to a sampleseriesmarker title, it is completely ignored. I am instead having to use " " as my separator.
a) Is there any way we can get the title to respect the \t character?
b) It would be great if it was smart enough to align labels nicely (much harder)
Thanks!
(screenshot is using 3 spaces instead of \t because the \t is just skipped over)
SamplesSeriesMarker title handling tab characters?
Moderator: Queue Moderators
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: SamplesSeriesMarker title handling tab characters?
Use monospace font and string formatting commands.
Code: Select all
StringBuilder sb = new StringBuilder();
int iSeriesNumber = 1;
string strChannelStringFormat = "Mill {0}: {1,12:#####.###} {2}";
bool bLabelVisible = false;
bool bAccurate = radioButtonAccurate.Checked;
string strValue="";
foreach (PointLineSeries series in m_chart.ViewXY.PointLineSeries)
{
//show series titles and cursor values in them, on the right side of the chart,
//if cursor values are not shown next to the cursor in an annotation
series.Title.Visible = !bShowNextToCursor;
bool bResolvedOK = false;
strValue = "";
if(bAccurate)
bResolvedOK = SolveValueAccurate(series, cursor.ValueAtXAxis, out dSeriesYValue);
else
bResolvedOK = SolveValueCoarse(series, cursor.ValueAtXAxis, out dSeriesYValue);
AxisY axisY = m_chart.ViewXY.YAxes[series.AssignYAxisIndex];
if (bResolvedOK)
{
bLabelVisible = true;
strValue = string.Format(strChannelStringFormat, iSeriesNumber, dSeriesYValue.ToString("0.0"), axisY.Units.Text);
}
else
{
strValue = string.Format(strChannelStringFormat, iSeriesNumber, "---", axisY.Units.Text);
}
sb.AppendLine(strValue);
series.Title.Text = strValue;
iSeriesNumber++;
}
sb.AppendLine("");
sb.AppendLine("Time: " + m_chart.ViewXY.XAxes[0].TimeString(cursor.ValueAtXAxis, "HH:mm:ss.ffff"));
//Set text
cursorValueDisplay.Text = sb.ToString();
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: SamplesSeriesMarker title handling tab characters?
I was hoping not to go in that direction, but it seems like the best bet. We're trying to move to this awesome new looking charting package, and monospaced fonts are ugly