Showing posts with label chart. Show all posts
Showing posts with label chart. Show all posts

Thursday, March 29, 2012

Drawing X & Y axis line on Scatter Chart where cross at: 0

I have a problem with a scatter graph.

The x values range from -80 to +40
The y vaules range from -6000 to +9000
Both need the axis to cross at 0

No gridlines are required on the graph apart from the main axis'. Which is where I'm struggling. The axis lines aren't drawn for the main axis points. However if I try to use 'gridlines' I end up with lines in other parts of the graph too, which is undesired.

How can I get the axis' to have their line drawn?

Thanks,
David (HN)

Did you try setting the axis major interval to a very large value (e.g. 10000)?

-- Robert

Draw marking line on Chart

I want to mark a value on the x-axis of a (stacked) bar chart. (So I want a horizontal line that is fixed on a chart.)

What I tried so far is adding an expression that says: =260 to the dataset, and I added that field to the Data Area of the chart. Then I plotted that value as a line.

This approach leaves me with 2 problems:
1. When the category grouping only has one group, there is no line, just a dot (or another marker you can select).
2. Because of the extra field in the Data Area of the chart, the legend holds useless information.

Isn't there another way to plot a horizontal line on a fixed value of the X-axis ?

I also took some screenshots so you can see for yourself. The charts display the ManDays per Year. The green color are the productive days and the blue are the non productive. I made charts of how they look right now, and how I want them to look. http://users.telenet.be/master/ict/charts.html

Owkey I couldn't make the line go all the way through but I managed to edit the legend by an example of Brain Welcker on custom legends. It can be found here: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx

So to draw a straight marking line on a chart: Add a field to the dataset containing the value where there has to be marked. Add that field to the data area of the chart. Set it so it will be displayed as a line. Remove the legend. Add a custom legend.

|||

My first question is how you plotted that field values - let's say we say that field name is Target Value right, how you plot that value as a Line in Bar Graph, I can't see in the Data area of that chart.

Can you explain in detail.

Thanks

|||

When I click twice on the chart, I see 3 area's: The Data, Series and Category area. In my data area there are two fields. One field is a sum of a database field, so that will create the bars.

The other field is a calculated field with expression "= 260" (because that is the value I want to mark on the chart) the field is called Marker. This field is added to the dataset which is used by the chart.

Then when you have dragged that field onto the data area, double click it and check these settings:
On the Values tab: the value property is =Fields!Marker.Value (when field is called marker)
On the Appearance tab: check the "show markers" and "plot data as line" checkboxes. This will draw a line with height= 260 on the x-axis (horizontal).

I hope this is clear enough, otherwise let me know ;)

|||

I am using Crystal Report 8.5... you are doing the same activity on Sql Server Reporting service ?

Thanks

NOOR

Draw Axis on Barchart

Hi,

I have a little problem with my barchart.
The chart shows negative and positive values and i want a simple vertical black line at 0.
But I havent found any solutions for this problem yet that satisfies me.

What I tried:
- Draw a normal line and place it above the graph -> doesnt work in all renderers
(Overlapping Reportitems are not supported ....)

-with the parameter "Cross At"
i have labels on the axis and if i "cross at" 0, the labels also move into the middle and overlap
with the bars/point labels

- with Gridlines (so far the best solution)
Chart with a fixed range (for example -100 to +100) and set the gridline interval to 100
this prints 3 Gridlines, 1st at -100, 2nd at 0 (what I want) and a 3rd at +100 - that would be ok for me
BUT i need a variable chart range!
so if the chart range goes from -100 to +200, i have a gridline at +100 crossing all bars !!

here are some pictures of my problem

what i want:
http://www.hmayer.net/show_image.php?id=4387&scaled&scalesize=800&nocount=y

what i got:
http://www.hmayer.net/show_image.php?id=4386&scaled&scalesize=800&nocount=y

any other ideas?

thanks,
GerhardYou can accomplish this with the following expression, if you are willing to have the min and max for the axis be the same absolute value. The expression calculates the largest value, in absolute terms, and sets the min(with negation), max and major interval properties on the Y-axis to this expression.

Min:

=-Math.Max(Max(Fields!FieldName.Value), Math.Abs(Min(Fields!FieldName.Value)))

Max:
=Math.Max(Max(Fields!FieldName.Value), Math.Abs(Min(Fields!FieldName.Value)))

Major Interval:
=Math.Max(Max(Fields!FieldName.Value), Math.Abs(Min(Fields!FieldName.Value)))

Note: Expressions for these properties are not su supported in RS 2000

Another approach would be to set the Cross At to 0 and not use tick marks or axis labels on the axis. Instead of using the labels, you could use a table placed beside the chart that contains these values. It may be tricky to get the labels line up correctly--make sure to sort the category group and the table the same way.

Ian

Wednesday, March 7, 2012

Don't show point labels if value is zero

Hey, I have a stacked column chart. It shows headcount per month. The headcount is split up into employees and contractors.

I added point labels to the chart to display the exact headcount value per month. (=Sum(Fields!HeadCount.Value)) Now here is the problem: Some months don't have contractors so there is a 0 displayed at the bottom of the X-axis. I don't want this to happen!

I already tried to change the expression of the point labels to this:
=IIF(Sum(Fields!HeadCount.Value,"chart1_SeriesGroup1") > 0,Round(Sum(Fields!HeadCount.Value),1)," ")

But this keeps displaying the 0. Even if the last parameter in the previous expression is 'nothing' it is still displayed.

I hope it is possible to remove them ...

Some additional info:
series field is: Contractor: which is a boolean that determines if the employee is contractor or not
category field is: Month (a month representation like ... January 2006, February 2006 ...)
Data field is: headcount (the headcounts of the employees).

You can use the datavalue to compare with 0. You don't have to compare the total of the chart1_SeriesGroup1 to 0.

Is your case: =IIF(Sum(Fields!HeadCount.Value) > 0,Round(Sum(Fields!HeadCount.Value),1)," ")