How to increase thickness of lines in Line Charts? - asp.net

How can we increase the thickness of the lines in Line charts (System.Web.UI.DataVisualization.Charting)? I tried to change the Font property of the Series, but found that it's read-only.

chart1.Series["Default"].BorderWidth = 2;
Very helpful collection of examples: http://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61

Click On chart, then you will see a Values filled and category groups Box on right side of graph, then in Values filled, right-click on any values Go to "Series Properties" --> "Border " -- > "Line Width" and then set the size.

Related

How to add top x-axis in xmgrace?

I have plotted a graph with xmgrace, the x-values are in linear scale of nm (for wavelength). I want to add a top reciprocal x-axis in eV units.
The formula to transform nm to eV is:
I could not find a way to add another x-axis without adding a new data set.
This is possible without any particular hack which, since we are dealing with xmgrace, is quite amazing :-)
Here is how you do it:
Open the axis properties
Select the "Alt X axis" option in the "edit" drop-down menu
Go to the "Tick labels" tab
Select "Opposite" as the Placement side
Put "1240 / $t" in the "Axis transform" textbox at the bottom
Click "Apply"

MS Project 2013 Chart - how to manually set min / max value of X-axis?

When creating a chart in the "Report" tab, I can use the "Format Axis" dialog to manually specify the min/max values when the Y-axis is selected, but I don't see those options when the X-axis is selected.
Is there a way to specify the min/max values for the X-axis?
Thanks in advance for your help!
P.S. Right now I'm using the "Chart Filter" icon (next to the upper right corner of the table) to select the timescale for the X-axis by manually selecting each day that needs to appear, but doing that is very time consuming and I'm hoping that there is a way to just specify the min/max values.
I found the solution:
Open the "Field List" dialog ("Design" tab / "Chart Data").
Select Category: "Time" & click adjacent "Edit" box (on right).
"Edit Timescale" dialog: change the Start and Finish dates to the desired values.

Issue with legend coloring in an RDLC

I'm working on a report using a business object data set. The business object is really simple it has three fields (ColorName, ColorCode, Date). I'm making a bar chart using the year from the Date as the category, ColorName as the series field, and count of ColorName as the "data" (the top area in the designer) field. So the graph will show each year along the bottom with series bars of the colors. In the "Series Properties" I have the fill set to ColorCode and my color code values are HTML color codes including the pound sign. The bar graph is working perfectly. The bars are the correct colors. The legend however is inconsistent. My current graph has 5 colors and only 3 of them are showing the correct color in the legend swatch. Two of them are black but they shouldn't be. If I change the color code for a ColorName then the graph updates correctly but the swatch is still black. I have another graph that is a pie chart which is doing the same thing but the legend works correctly in that one. Anybody have an idea where I can look to resolve this legend color issue?
It looks like if any year had no series values then the legend would not work correctly. And it seems to only happen when you add a series to the report. The solution was to update my query to return counts instead of rows; including 0 counts for series that had no records. This way every series/category group had it's own record in the data set.
I have applied the same case for Rating Score 1 to 5. For each series I needed to color each bar in the Bar Chart according to the following factors (1:Poor, 2:Average, 3:Good, 4:Very Good, 5:Excellent).
Right click on any bar in the chart and select Series Properties.
Select Fill, Set background fill options - Fill Style to Solid.
Enter the below formula in the formula editor:
=IIF(Fields!Rating.Value=1, "Tomato", IIF(Fields!Rating.Value=2, "Orange", IIF(Fields!Rating.Value=3, "#cdf8cd", IIF(Fields!Rating.Value=4, "#7de67d", "Lime"))))
Hope this helps.

Set maximum width of labels in an ASP.NET Chart

I am using the .NET 4 Chart control to create a bar chart. I have labels listed along the left axis (I believe this is the y-axis, I may be wrong). I want to set the maximum width that this axis can be. Currently, I have some labels that are really large. Ideally, I would like to truncate them. However, I cannot figure out how to do either of these.
Can someone tell me how to set the maximum width used by the labels in a Chart? Is it possible to truncate the labels so that if they are larger than the alloted space a "..." appears?
Thank you
I think below code helps to truncate x-axis width. check out something similar to this.
Chart1.Series("Series1")("PixelPointWidth") = "35"

ZedGraph - How to force first and last bars have x-axis labels?

Using Zedgraph (asp.net). I have a bar graph based on datetime x points. The first bar does not have a label. The first label is at the y-axis corresponding to a day before my first day point. I am not too concerned about this. However the second label is at the second bar. I need the first bar to have a label. I do have MyPane.XAxis.Scale.IsSkipFirstLabel = false.
How do I force the first bar to have a label? Why is ZedGraph not putting a label there?
Addition:
I want '5/20' to display for the first bar instead of 5/19 under the y-axis. I don't even have an entry for 5/19.
alt text http://i50.tinypic.com/29ogx0n_th.gif
OK, I don't know if that's exactly what you need, but:
First, adjust your scale ranges manually:
zg1.MasterPane[0].XAxis.Scale.Min = (double)new XDate(2010, 05, 19);
zg1.MasterPane[0].XAxis.Scale.Max = (double)new XDate(2010, 05,30);
This will set the ranges of your scale to show one day before and one day after your data (this is needed to have extra space)
then, set the step:
zg1.MasterPane[0].XAxis.Scale.MajorStep = 1;
zg1.MasterPane[0].XAxis.Scale.FontSpec.Angle = 90f;
This will cause you will have one label for each day. In fact, this is the only way to have more or less control over the labels that appear. I've also changed the angle of labels (in normal position it would overlap).
But it would create the labels for first and last extra days too (margins). So we need to disable these two entries (now it would work, because you've set the ranges manually).
zg1.MasterPane[0].XAxis.Scale.IsSkipFirstLabel = true;
zg1.MasterPane[0].XAxis.Scale.IsSkipLastLabel = true;
If you just want to disable this first and last extra label and leave the rest to the ZedGraph, just ommit the second step. But the outcome could be sometimes unpredictable.

Resources