.NET Chart Box Plot Bleeding outside chart area - asp.net

I see that when a Box crosses max and min limit on the Y-axis the box bleeds outside the chart area. Is there a solution/Tweak for this?

Are you setting the Min and Max values yourself or letting the control decide? Try setting them to auto.
chart1.ChartAreas[0].AxisY.Maximum = double.NaN;
chart1.ChartAreas[0].AxisY.Minimum = double.NaN;

Try the following:
chart1.ChartAreas[0].AxisY.Crossing = 0;
chart1.ChartAreas[0].AxisX.Crossing = 0;

Related

How to change label position in EPPLUS doughnut chart?

My doughnut chart has overlapped labels and it is unreadable. How to make the labels readable by moving them? Is there a property to set?
You can fix this by enabling legend like this,
var dougnutChartStyles = (ExcelPieChartSerie)doughnutSeries;
dougnutChartStyles.DataLabel.ShowCategory = false;
and
var excelDoughnut = worksheet.Drawings.AddChart("pieChart", eChartType.Pie3D);
excelDoughnut.Legend.Position = eLegendPosition.Right;
So, labels will display as legends, not in the chart itself.

QProgressDialog: How to adjust the width to show the whole progress bar?

I create a QProgressDialog, set a QProgressBar to it. Set the format
"Processing section %v of %m. Percentage completed: %p."
to the QProgressBar. But the text is cut, not the whole progress bar is displayed on the dialog.
How to adjust the width to show the whole progress bar?
Here is an example which uses QFontMetrics to get the width of the progress bar's text, and then adds 100px to this for the progress bar itself. When the dialog is shown, it is resized to this width.
auto dialog = new QProgressDialog();
dialog->setWindowTitle("Progress");
dialog->setLabelText("Test progress dialog");
auto bar = new QProgressBar(dialog);
bar->setTextVisible(true);
bar->setValue(50);
bar->setFormat("Processing section %v of %m. Percentage completed: %p");
dialog->setBar(bar);
// Use QFontMetrics to get the width of the bar text,
// and then add 100px for the progress bar itself. Set
// this to the initial dialog width.
int width = QFontMetrics(bar->font()).width(bar->text()) + 100;
dialog->resize(width, dialog->height());
dialog->show();
This allows you to avoid hardcoding a width, although it's a bit complicated. I think just setting a reasonable minimum width like below is probably a better/simpler solution:
dialog->setMinimumWidth(300);

how to reduce number of tick label in javafx categoryaxis

I'm drawing a line chart with javafx categoryaxis. e.g. I have 100 points on the plot. As such, all of my tick labels are squished together, resulting in 100 bunched-up ellipses. All I want to do is render every tenth label. I've looked through the documentation but there doesn't seem to be any way to turn individual tick labels visible or invisible, or how to change the setting of the tick unit on a CategoryAxis.
or I have to redraw xAxis?
just got an idea, add number of invisible char into the categoryaxis, so that each xaxis is still 'unique'
if (i%5 == 0)
str = DateFormat.getDateInstance(DateFormat.DEFAULT).format(date);
else {
str = invisible;
invisible += (char)29;
}

setting minimum level of chart in asp.net

By default, minimum level of ASP.NET chart control is 0, I want to set this level to -1. So that 0 value on y-axis can be shown correctly...
This should work.
var chart = new Chart();
//
// Code to define chart areas etc...
//
chart.ChartAreas[0].AxisY.Minimum = -1;

Visual Studio 2010 Chart control - line color

How do I change the color of the horizonal and vertical lines? I'd like to make them a little lighter, yet leave the X and Y axis black, probably.
Edited:
indyfromoz suggestion resulted in this:
The effect I want is this:
(Subtler horiz and vertical lines, maybe even no vertical lines.)
VB
Chart1.ChartAreas(0).AxisY.MajorGrid.LineColor = Color.FromArgb(&H50, &H9C, &H9A, &H95)
Chart1.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.FromArgb(&H50, &H9C, &H9A, &H95)
C#
Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.FromArgb(50, 200, 200, 200);
Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.FromArgb(50, 200, 200, 200);
You have two options - use the Axis.IsInterlaced property or the Axis.StripLines property. This page is a handy reference for customization of the grid lines in a chart.
Here is some sample C# code (from the above reference) -
chart1.ChartAreas[0].AxisY.StripLines.Add(new StripLine());
chart1.ChartAreas[0].AxisY.StripLines[0].BackColor = Color.FromArgb(80, 252, 180, 65);
chart1.ChartAreas[0].AxisY.StripLines[0].StripWidth = 40;
chart1.ChartAreas[0].AxisY.StripLines[0].Interval = 10000;
chart1.ChartAreas[0].AxisY.StripLines[0].IntervalOffset **
HTH, indyfromoz

Resources