This is a migrated thread and some comments may be shown as answers.

Multiple series on graph

8 Answers 506 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 01 Mar 2014, 03:06 AM
Hi Telerik

Im playing around with a graph with two series. A stacked Bar and a line. (A bit like the demo http://www.telerik.com/help/reporting/graphhowtocreategraphwithcolumnandlineseries.html)
Ive got separate Y axis as well. (http://www.telerik.com/help/reporting/graphhowtoaddsecondaryaxis.html)


At processing time, ie in the itemdatabinding event for the graph,is it possible to hide the Y axis for either or both Yaxis?

I use the following...

var processingGraph = (Telerik.Reporting.Processing.DataItem)sender;
var graph = (Telerik.Reporting.Graph)processingGraph.ItemDefinition;

// Hide the 
 (graph.Series[1].CoordinateSystem as CartesianCoordinateSystem).YAxis.Style.Visible = false;   
and then show it again with ...
 (graph.Series[1].CoordinateSystem as CartesianCoordinateSystem).YAxis.Style.Visible = false;   
But this leaves the major step markers....


Any ideas?


Mike















8 Answers, 1 is accepted

Sort by
0
Ivan Hristov
Telerik team
answered on 05 Mar 2014, 12:34 PM
Hi Mike,

In order to understand your problem better and give you a proper advice, we would like you to describe us the scenario that requires to set the axis visibility during processing. Usually such things should be done using the designer to ensure that the report definition will be processed correctly.

It is highly recommended not to use events like ItemDataBound when designing reports. If you really need to make such changes, it is better to do so in the report constructor after the InitializeComponent method. This way changes will be applied prior the report processing is started.
For more information see Report Life Cycle help article.

Regards,
Ivan Hristov
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Mike
Top achievements
Rank 1
answered on 05 Mar 2014, 07:42 PM
Hi Ivan

I have to set the datasource for  each series in the itemdatabinding event. I have a graph for each record of the report source. Hence I get an event for each record. So the axis visibility may change during the overall processing of the records.

When there is no data for one of the series, hide the axis for that series. Simple??

What I find using my code snippet is that the visibility of the individual graphs gets "confused". Its like the last graph's visibility setting affects the previous.

Furthermore, why does the legend show when there is no data? (See last graph in pdf)


0
Mike
Top achievements
Rank 1
answered on 05 Mar 2014, 07:50 PM
Actually, Capture2.png is after Capture.png in the final report.
0
Ivan Hristov
Telerik team
answered on 10 Mar 2014, 01:53 PM
Hello Mike,

We understand your scenario, but it will be very helpful if you can provide a screenshot of your report, showing how the graphs look on several rows/records of your data source - i.e. how it looks when there are visible axes but no series are shown. Even better, if you could create a runnable sample of your report, demonstrating the issues you are having, we could test it on our side and provide you with a solution suited for your needs.

  • As a workaround we can suggest you to move your code from ItemDataBound to ItemDataBinding event, although, as we stated earlier, using the events to change the definition is strictly not recommended. Please also keep in mind that the events behavior could change in a subsequent release due to a refactoring in Telerik Reporting.
  • The Legend shows all the existing series in your data source by default, as explained in this documentation article:
        If a legend item appears in the legend but the corresponding series is not displayed in the chart, the most likely cause is that the series does not contain any values. You must remove this series in order to remove the legend item from the legend.

    In case you would like to hide some of the legend items, you should apply Filtering on your series groups or use the LegendItem.ConditionalFormatting property and assign it accordingly.

Regards,

Ivan Hristov
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Mike
Top achievements
Rank 1
answered on 10 Mar 2014, 08:54 PM

This is the idea.

The first graph takes the secondary Y axis/legend visibility from the report parameter.
The subsequent graphs should take the opposite.

The result is that the vis is taken from visibility setting of the last items. All secondary Y axis are either hidden or visible.

Sorry cant upload the source files. Hope this is OK..

Also by the way Im an Ultimate member now, so maybe I can call you. I have put in for a remote assistance on this through the member forum.

namespace ReportsLibrary
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;

/// <summary>
/// Summary description for Report1.
/// </summary>
public partial class Report1 : Telerik.Reporting.Report
{
public Report1()
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}
bool bFirst = true;
private void graph1_ItemDataBinding(object sender, EventArgs e)
{

var processingGraph = (Telerik.Reporting.Processing.DataItem)sender;
var graph = (Telerik.Reporting.Graph)processingGraph.ItemDefinition;
bool bFirstVisible = (bool)processingGraph.Report.Parameters["FirstVisible"].Value;

if (bFirst)
{
(graph.Series[1].CoordinateSystem as CartesianCoordinateSystem).YAxis.Style.Visible = bFirstVisible;
graph.Series[1].LegendItem.Style.Visible = bFirstVisible;
}
else
{
(graph.Series[1].CoordinateSystem as CartesianCoordinateSystem).YAxis.Style.Visible = !bFirstVisible;
graph.Series[1].LegendItem.Style.Visible = !bFirstVisible;
}

bFirst = false;
}
}
}





namespace ReportsLibrary
{
partial class Report1
{
#region Component Designer generated code
/// <summary>
/// Required method for telerik Reporting designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
Telerik.Reporting.GraphGroup graphGroup1 = new Telerik.Reporting.GraphGroup();
Telerik.Reporting.GraphGroup graphGroup3 = new Telerik.Reporting.GraphGroup();
Telerik.Reporting.GraphTitle graphTitle1 = new Telerik.Reporting.GraphTitle();
Telerik.Reporting.CategoryScale categoryScale1 = new Telerik.Reporting.CategoryScale();
Telerik.Reporting.CategoryScaleCrossAxisPosition categoryScaleCrossAxisPosition1 = new Telerik.Reporting.CategoryScaleCrossAxisPosition();
Telerik.Reporting.CategoryScaleCrossAxisPosition categoryScaleCrossAxisPosition2 = new Telerik.Reporting.CategoryScaleCrossAxisPosition();
Telerik.Reporting.NumericalScale numericalScale1 = new Telerik.Reporting.NumericalScale();
Telerik.Reporting.NumericalScale numericalScale3 = new Telerik.Reporting.NumericalScale();
Telerik.Reporting.GraphGroup graphGroup2 = new Telerik.Reporting.GraphGroup();
Telerik.Reporting.NumericalScale numericalScale2 = new Telerik.Reporting.NumericalScale();
Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter();
Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();
Telerik.Reporting.Drawing.StyleRule styleRule2 = new Telerik.Reporting.Drawing.StyleRule();
Telerik.Reporting.Drawing.StyleRule styleRule3 = new Telerik.Reporting.Drawing.StyleRule();
Telerik.Reporting.Drawing.StyleRule styleRule4 = new Telerik.Reporting.Drawing.StyleRule();
this.sqlDataSource1 = new Telerik.Reporting.SqlDataSource();
this.pageHeader = new Telerik.Reporting.PageHeaderSection();
this.reportNameTextBox = new Telerik.Reporting.TextBox();
this.pageFooter = new Telerik.Reporting.PageFooterSection();
this.currentTimeTextBox = new Telerik.Reporting.TextBox();
this.pageInfoTextBox = new Telerik.Reporting.TextBox();
this.reportHeader = new Telerik.Reporting.ReportHeaderSection();
this.titleTextBox = new Telerik.Reporting.TextBox();
this.reportFooter = new Telerik.Reporting.ReportFooterSection();
this.detail = new Telerik.Reporting.DetailSection();
this.graph1 = new Telerik.Reporting.Graph();
this.cartesianCoordinateSystem1 = new Telerik.Reporting.CartesianCoordinateSystem();
this.graphAxis2 = new Telerik.Reporting.GraphAxis();
this.graphAxis1 = new Telerik.Reporting.GraphAxis();
this.cartesianCoordinateSystem2 = new Telerik.Reporting.CartesianCoordinateSystem();
this.graphAxis3 = new Telerik.Reporting.GraphAxis();
this.barSeries1 = new Telerik.Reporting.BarSeries();
this.lineSeries1 = new Telerik.Reporting.LineSeries();
this.textBox1 = new Telerik.Reporting.TextBox();
this.graphAxis4 = new Telerik.Reporting.GraphAxis();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// sqlDataSource1
//
this.sqlDataSource1.ConnectionString = "ReportsLibrary.Properties.Settings.NORTHWNDConnectionString";
this.sqlDataSource1.Name = "sqlDataSource1";
this.sqlDataSource1.SelectCommand = "SELECT CustomerID\r\nFROM Customers";
//
// pageHeader
//
this.pageHeader.Height = Telerik.Reporting.Drawing.Unit.Cm(1.0846666097640991D);
this.pageHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.reportNameTextBox});
this.pageHeader.Name = "pageHeader";
//
// reportNameTextBox
//
this.reportNameTextBox.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0.04233333095908165D), Telerik.Reporting.Drawing.Unit.Cm(0.04233333095908165D));
this.reportNameTextBox.Name = "reportNameTextBox";
this.reportNameTextBox.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(15.750666618347168D), Telerik.Reporting.Drawing.Unit.Cm(1D));
this.reportNameTextBox.StyleName = "PageInfo";
this.reportNameTextBox.Value = "Report1";
//
// pageFooter
//
this.pageFooter.Height = Telerik.Reporting.Drawing.Unit.Cm(1.0846666097640991D);
this.pageFooter.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.currentTimeTextBox,
this.pageInfoTextBox});
this.pageFooter.Name = "pageFooter";
//
// currentTimeTextBox
//
this.currentTimeTextBox.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0.04233333095908165D), Telerik.Reporting.Drawing.Unit.Cm(0.04233333095908165D));
this.currentTimeTextBox.Name = "currentTimeTextBox";
this.currentTimeTextBox.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(7.8541665077209473D), Telerik.Reporting.Drawing.Unit.Cm(1D));
this.currentTimeTextBox.StyleName = "PageInfo";
this.currentTimeTextBox.Value = "=NOW()";
//
// pageInfoTextBox
//
this.pageInfoTextBox.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(7.9388332366943359D), Telerik.Reporting.Drawing.Unit.Cm(0.04233333095908165D));
this.pageInfoTextBox.Name = "pageInfoTextBox";
this.pageInfoTextBox.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(7.8541665077209473D), Telerik.Reporting.Drawing.Unit.Cm(1D));
this.pageInfoTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right;
this.pageInfoTextBox.StyleName = "PageInfo";
this.pageInfoTextBox.Value = "=PageNumber";
//
// reportHeader
//
this.reportHeader.Height = Telerik.Reporting.Drawing.Unit.Cm(2.0423333644866943D);
this.reportHeader.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.titleTextBox});
this.reportHeader.Name = "reportHeader";
//
// titleTextBox
//
this.titleTextBox.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0D), Telerik.Reporting.Drawing.Unit.Cm(0D));
this.titleTextBox.Name = "titleTextBox";
this.titleTextBox.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(15.835332870483398D), Telerik.Reporting.Drawing.Unit.Cm(2D));
this.titleTextBox.StyleName = "Title";
this.titleTextBox.Value = "Report1";
//
// reportFooter
//
this.reportFooter.Height = Telerik.Reporting.Drawing.Unit.Cm(0.57150000333786011D);
this.reportFooter.Name = "reportFooter";
//
// detail
//
this.detail.Height = Telerik.Reporting.Drawing.Unit.Cm(8.27299976348877D);
this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.graph1,
this.textBox1});
this.detail.Name = "detail";
//
// graph1
//
graphGroup1.Name = "categoryGroup";
this.graph1.CategoryGroups.Add(graphGroup1);
this.graph1.CoordinateSystems.Add(this.cartesianCoordinateSystem1);
this.graph1.CoordinateSystems.Add(this.cartesianCoordinateSystem2);
this.graph1.DataSource = this.sqlDataSource1;
this.graph1.Legend.Style.LineColor = System.Drawing.Color.LightGray;
this.graph1.Legend.Style.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
this.graph1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(2.5D), Telerik.Reporting.Drawing.Unit.Cm(0.97299998998641968D));
this.graph1.Name = "graph1";
this.graph1.PlotAreaStyle.LineColor = System.Drawing.Color.LightGray;
this.graph1.PlotAreaStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
this.graph1.Series.Add(this.barSeries1);
this.graph1.Series.Add(this.lineSeries1);
graphGroup3.Name = "graphGroup";
this.graph1.SeriesGroups.Add(graphGroup2);
this.graph1.SeriesGroups.Add(graphGroup3);
this.graph1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(10.59999942779541D), Telerik.Reporting.Drawing.Unit.Cm(6.3000001907348633D));
this.graph1.Style.Padding.Bottom = Telerik.Reporting.Drawing.Unit.Pixel(10D);
this.graph1.Style.Padding.Left = Telerik.Reporting.Drawing.Unit.Pixel(10D);
this.graph1.Style.Padding.Right = Telerik.Reporting.Drawing.Unit.Pixel(10D);
this.graph1.Style.Padding.Top = Telerik.Reporting.Drawing.Unit.Pixel(10D);
graphTitle1.Position = Telerik.Reporting.GraphItemPosition.TopCenter;
graphTitle1.Style.LineColor = System.Drawing.Color.LightGray;
graphTitle1.Style.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
graphTitle1.Text = "graph1";
this.graph1.Titles.Add(graphTitle1);
this.graph1.ItemDataBinding += new System.EventHandler(this.graph1_ItemDataBinding);
//
// cartesianCoordinateSystem1
//
this.cartesianCoordinateSystem1.Name = "cartesianCoordinateSystem1";
this.cartesianCoordinateSystem1.XAxis = this.graphAxis2;
this.cartesianCoordinateSystem1.YAxis = this.graphAxis1;
//
// graphAxis2
//
this.graphAxis2.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis2.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis2.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis2.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis2.MinorGridLineStyle.Visible = false;
this.graphAxis2.Name = "graphAxis2";
categoryScaleCrossAxisPosition1.Position = Telerik.Reporting.GraphScaleCrossAxisPosition.Auto;
categoryScaleCrossAxisPosition2.Position = Telerik.Reporting.GraphScaleCrossAxisPosition.AtMaximum;
categoryScale1.CrossAxisPositions.Add(categoryScaleCrossAxisPosition1);
categoryScale1.CrossAxisPositions.Add(categoryScaleCrossAxisPosition2);
this.graphAxis2.Scale = categoryScale1;
//
// graphAxis1
//
this.graphAxis1.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis1.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis1.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis1.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis1.MinorGridLineStyle.Visible = false;
this.graphAxis1.Name = "graphAxis1";
this.graphAxis1.Scale = numericalScale1;
//
// cartesianCoordinateSystem2
//
this.cartesianCoordinateSystem2.Name = "cartesianCoordinateSystem2";
this.cartesianCoordinateSystem2.XAxis = this.graphAxis2;
this.cartesianCoordinateSystem2.YAxis = this.graphAxis4;
//
// graphAxis3
//
this.graphAxis3.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis3.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis3.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis3.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis3.MinorGridLineStyle.Visible = false;
this.graphAxis3.Name = "GraphAxis1";
this.graphAxis3.Scale = numericalScale3;
//
// barSeries1
//
this.barSeries1.CategoryGroup = graphGroup1;
this.barSeries1.CoordinateSystem = this.cartesianCoordinateSystem1;
this.barSeries1.LegendItem.Style.BackgroundColor = System.Drawing.Color.Transparent;
this.barSeries1.LegendItem.Style.LineColor = System.Drawing.Color.Transparent;
this.barSeries1.LegendItem.Style.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
graphGroup2.Name = "seriesGroup";
this.barSeries1.SeriesGroup = graphGroup2;
this.barSeries1.Y = "= Fields.Y";
//
// lineSeries1
//
this.lineSeries1.CategoryGroup = graphGroup1;
this.lineSeries1.CoordinateSystem = this.cartesianCoordinateSystem2;
this.lineSeries1.DataPointStyle.Visible = false;
this.lineSeries1.LegendItem.Style.BackgroundColor = System.Drawing.Color.Transparent;
this.lineSeries1.LegendItem.Style.LineColor = System.Drawing.Color.Transparent;
this.lineSeries1.LegendItem.Style.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
this.lineSeries1.LineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.lineSeries1.MarkerMaxSize = Telerik.Reporting.Drawing.Unit.Pixel(50D);
this.lineSeries1.MarkerMinSize = Telerik.Reporting.Drawing.Unit.Pixel(5D);
this.lineSeries1.MarkerSize = Telerik.Reporting.Drawing.Unit.Pixel(5D);
this.lineSeries1.SeriesGroup = graphGroup2;
this.lineSeries1.Size = null;
this.lineSeries1.Y = "= Fields.Y";
//
// textBox1
//
this.textBox1.CanGrow = false;
this.textBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0.04233333095908165D), Telerik.Reporting.Drawing.Unit.Cm(0D));
this.textBox1.Name = "textBox1";
this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(3D), Telerik.Reporting.Drawing.Unit.Cm(1D));
this.textBox1.Value = "= Fields.CustomerID";
//
// graphAxis4
//
this.graphAxis4.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis4.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis4.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
this.graphAxis4.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
this.graphAxis4.MinorGridLineStyle.Visible = false;
this.graphAxis4.Name = "GraphAxis1";
this.graphAxis4.Scale = numericalScale2;
//
// Report1
//
this.DataSource = this.sqlDataSource1;
this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.pageHeader,
this.pageFooter,
this.reportHeader,
this.reportFooter,
this.detail});
this.Name = "Report1";
this.PageSettings.Margins = new Telerik.Reporting.Drawing.MarginsU(Telerik.Reporting.Drawing.Unit.Mm(25.399999618530273D), Telerik.Reporting.Drawing.Unit.Mm(25.399999618530273D), Telerik.Reporting.Drawing.Unit.Mm(25.399999618530273D), Telerik.Reporting.Drawing.Unit.Mm(25.399999618530273D));
this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
reportParameter1.AllowBlank = false;
reportParameter1.Name = "FirstVisible";
reportParameter1.Text = "FirstVisible";
reportParameter1.Type = Telerik.Reporting.ReportParameterType.Boolean;
reportParameter1.Visible = true;
this.ReportParameters.Add(reportParameter1);
this.Style.BackgroundColor = System.Drawing.Color.White;
styleRule1.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
new Telerik.Reporting.Drawing.StyleSelector("Title")});
styleRule1.Style.Color = System.Drawing.Color.Black;
styleRule1.Style.Font.Bold = true;
styleRule1.Style.Font.Italic = false;
styleRule1.Style.Font.Name = "Tahoma";
styleRule1.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(18D);
styleRule1.Style.Font.Strikeout = false;
styleRule1.Style.Font.Underline = false;
styleRule2.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
new Telerik.Reporting.Drawing.StyleSelector("Caption")});
styleRule2.Style.Color = System.Drawing.Color.Black;
styleRule2.Style.Font.Name = "Tahoma";
styleRule2.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(10D);
styleRule2.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
styleRule3.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
new Telerik.Reporting.Drawing.StyleSelector("Data")});
styleRule3.Style.Font.Name = "Tahoma";
styleRule3.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(9D);
styleRule3.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
styleRule4.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
new Telerik.Reporting.Drawing.StyleSelector("PageInfo")});
styleRule4.Style.Font.Name = "Tahoma";
styleRule4.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(8D);
styleRule4.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] {
styleRule1,
styleRule2,
styleRule3,
styleRule4});
this.Width = Telerik.Reporting.Drawing.Unit.Cm(17.399999618530273D);
((System.ComponentModel.ISupportInitialize)(this)).EndInit();

}
#endregion

private Telerik.Reporting.SqlDataSource sqlDataSource1;
private Telerik.Reporting.PageHeaderSection pageHeader;
private Telerik.Reporting.TextBox reportNameTextBox;
private Telerik.Reporting.PageFooterSection pageFooter;
private Telerik.Reporting.TextBox currentTimeTextBox;
private Telerik.Reporting.TextBox pageInfoTextBox;
private Telerik.Reporting.ReportHeaderSection reportHeader;
private Telerik.Reporting.TextBox titleTextBox;
private Telerik.Reporting.ReportFooterSection reportFooter;
private Telerik.Reporting.DetailSection detail;
private Telerik.Reporting.Graph graph1;
private Telerik.Reporting.CartesianCoordinateSystem cartesianCoordinateSystem1;
private Telerik.Reporting.GraphAxis graphAxis2;
private Telerik.Reporting.GraphAxis graphAxis1;
private Telerik.Reporting.TextBox textBox1;
private Telerik.Reporting.BarSeries barSeries1;
private Telerik.Reporting.LineSeries lineSeries1;
private Telerik.Reporting.CartesianCoordinateSystem cartesianCoordinateSystem2;
private Telerik.Reporting.GraphAxis graphAxis3;
private Telerik.Reporting.GraphAxis graphAxis4;

}
}






0
Ivan Hristov
Telerik team
answered on 11 Mar 2014, 03:11 PM
Hi Mike,

Thank you for the provided code. We figured out what you are trying to achieve and we can suggest you a
workaround.

The code you are using to change the axis visibility, actually changes the graph definition that is used to create the processing graphs. During the processing, the changes you have applied to the definition are applied to any of the processing graph items.

As a workaround we might suggest you to use two graphs - the first one will be visible only on the first record of your dataset and then you will make it invisible. The second one acts the opposite way - it is invisible on the first record and then becomes visible. The visibility control is performed using ConditionalFormatting rules and a user function.

Please find attached a sample report based on the code you provided that shows how such a behavior could be achieved.

Hope it helps.

Regards,
Ivan Hristov
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Mike
Top achievements
Rank 1
answered on 13 Mar 2014, 12:13 AM
HI Ivan
Doesn't the suggested solution mean that both graphs get processed per detail item?
My processing is significant per detail item, and I think for a big dataset the processing time may become critical.

I believe that the old chart object could be manipulated in the processing. Is this something you have overlooked in the updated graph?
cheers
Mike
0
Ivan Hristov
Telerik team
answered on 14 Mar 2014, 09:45 AM
Hello Mike,

Yes, you are right - the both graphs would be processed, because of the applied conditional formatting that requires processing the data.

We omitted the availability to manipulate the items during processing for purpose - the main idea is to have an item definition and all the processing items descend from it. All the needed changes should be done using declarative approach like Conditional Formatting and Binding properties.

The old chart is based on the UI for ASP.NET AJAX Chart and do not use our reporting engine. Thus it doesn't support many of the reporting declarative functionality. Additionally it is not capable to render with the rendering formats graphical elements. Instead the old Chart item renders as bitmap in most of the rendering extensions.

Regards,
Ivan Hristov
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Ivan Hristov
Telerik team
Mike
Top achievements
Rank 1
Share this question
or