Background image of Graph PlotAreaStyle not working

3 posts, 0 answers
  1. Kenneth
    Kenneth avatar
    4 posts
    Member since:
    Aug 2011

    Posted 02 Oct 2014 Link to this post

    Hi

    I'm trying to set a background image on a bubble chart, but I haven't managed to get it to appear. It works fine if I set a background on the overall graph, but not on the plotareastyle.

    The code generated from the designer is below, any idea where I'm going wrong.

    Another quick question, I'm trying to use a background image instead of Marked Zones, as these don't seem to be supported on the Graph object - are they hiding on the Graph object under another name anywhere?

    Thanks

    ---

    namespace ReportTest
    {
    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 graphGroup4 = new Telerik.Reporting.GraphGroup();
    Telerik.Reporting.GraphTitle graphTitle1 = new Telerik.Reporting.GraphTitle();
    Telerik.Reporting.NumericalScale numericalScale1 = new Telerik.Reporting.NumericalScale();
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Report1));
    Telerik.Reporting.NumericalScale numericalScale2 = new Telerik.Reporting.NumericalScale();
    Telerik.Reporting.DataColumn dataColumn1 = new Telerik.Reporting.DataColumn();
    Telerik.Reporting.DataColumn dataColumn2 = new Telerik.Reporting.DataColumn();
    Telerik.Reporting.DataColumn dataColumn3 = new Telerik.Reporting.DataColumn();
    Telerik.Reporting.DataColumn dataColumn4 = new Telerik.Reporting.DataColumn();
    Telerik.Reporting.GraphGroup graphGroup2 = new Telerik.Reporting.GraphGroup();
    Telerik.Reporting.GraphGroup graphGroup3 = new Telerik.Reporting.GraphGroup();
    Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();
    this.detailSection1 = new Telerik.Reporting.DetailSection();
    this.graph1 = new Telerik.Reporting.Graph();
    this.cartesianCoordinateSystem1 = new Telerik.Reporting.CartesianCoordinateSystem();
    this.graphAxis1 = new Telerik.Reporting.GraphAxis();
    this.graphAxis2 = new Telerik.Reporting.GraphAxis();
    this.csvDataSource1 = new Telerik.Reporting.CsvDataSource();
    this.lineSeries1 = new Telerik.Reporting.LineSeries();
    ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
    //
    // detailSection1
    //
    this.detailSection1.Height = Telerik.Reporting.Drawing.Unit.Cm(11.795207977294922D);
    this.detailSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
    this.graph1});
    this.detailSection1.Name = "detailSection1";
    //
    // graph1
    //
    graphGroup1.Name = "seriesGroup";
    this.graph1.CategoryGroups.Add(graphGroup1);
    this.graph1.CoordinateSystems.Add(this.cartesianCoordinateSystem1);
    this.graph1.DataSource = this.csvDataSource1;
    this.graph1.Docking = Telerik.Reporting.DockingStyle.Fill;
    this.graph1.Legend.Style.LineColor = System.Drawing.Color.LightGray;
    this.graph1.Legend.Style.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
    this.graph1.Legend.Style.Visible = false;
    this.graph1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0D), Telerik.Reporting.Drawing.Unit.Cm(0D));
    this.graph1.Name = "graph1";
    this.graph1.PlotAreaStyle.BackgroundImage.ImageData = ((System.Drawing.Image)(resources.GetObject("graph1.PlotAreaStyle.BackgroundImage.ImageData")));
    this.graph1.PlotAreaStyle.BackgroundImage.MimeType = "image/png";
    this.graph1.PlotAreaStyle.BackgroundImage.Repeat = ((Telerik.Reporting.Drawing.BackgroundRepeat)((Telerik.Reporting.Drawing.BackgroundRepeat.RepeatX | Telerik.Reporting.Drawing.BackgroundRepeat.RepeatY)));
    this.graph1.PlotAreaStyle.LineColor = System.Drawing.Color.LightGray;
    this.graph1.PlotAreaStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Cm(0D);
    this.graph1.PlotAreaStyle.Visible = true;
    this.graph1.Series.Add(this.lineSeries1);
    graphGroup4.Groupings.Add(new Telerik.Reporting.Grouping("=Fields.Label"));
    graphGroup4.Name = "labelGroup";
    graphGroup4.Sortings.Add(new Telerik.Reporting.Sorting("=Fields.Label", Telerik.Reporting.SortDirection.Asc));
    this.graph1.SeriesGroups.Add(graphGroup4);
    this.graph1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(17.799999237060547D), Telerik.Reporting.Drawing.Unit.Cm(11.795207977294922D));
    this.graph1.Style.BackgroundImage.MimeType = "image/png";
    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 = "October 2014";
    this.graph1.Titles.Add(graphTitle1);
    //
    // cartesianCoordinateSystem1
    //
    this.cartesianCoordinateSystem1.Name = "cartesianCoordinateSystem1";
    this.cartesianCoordinateSystem1.XAxis = this.graphAxis1;
    this.cartesianCoordinateSystem1.YAxis = this.graphAxis2;
    //
    // 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";
    numericalScale1.Maximum = 10D;
    numericalScale1.Minimum = 0D;
    this.graphAxis1.Scale = numericalScale1;
    this.graphAxis1.Title = "X - Label";
    //
    // graphAxis2
    //
    this.graphAxis2.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
    this.graphAxis2.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
    this.graphAxis2.MajorGridLineStyle.Visible = true;
    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";
    numericalScale2.Maximum = 10D;
    numericalScale2.Minimum = 0D;
    this.graphAxis2.Scale = numericalScale2;
    this.graphAxis2.Title = "Y - Label";
    //
    // csvDataSource1
    //
    dataColumn1.Name = "A";
    dataColumn1.Type = Telerik.Reporting.SimpleType.Integer;
    dataColumn2.Name = "B";
    dataColumn2.Type = Telerik.Reporting.SimpleType.Integer;
    dataColumn3.Name = "C";
    dataColumn3.Type = Telerik.Reporting.SimpleType.Integer;
    dataColumn4.Name = "Label";
    this.csvDataSource1.Columns.Add(dataColumn1);
    this.csvDataSource1.Columns.Add(dataColumn2);
    this.csvDataSource1.Columns.Add(dataColumn3);
    this.csvDataSource1.Columns.Add(dataColumn4);
    this.csvDataSource1.FieldSeparators = new char[] {
    ','};
    this.csvDataSource1.HasHeaders = true;
    this.csvDataSource1.Name = "csvDataSource1";
    this.csvDataSource1.RecordSeparators = new char[] {
    '\r',
    '\n'};
    this.csvDataSource1.Source = "A,B,C,Label\r\n1,2,3,Item One\r\n2,3,5,Item Two\r\n5,4,9,Item Three\r\n8,6,14,Item Four";
    //
    // lineSeries1
    //
    graphGroup2.Name = "seriesGroup";
    this.lineSeries1.CategoryGroup = graphGroup2;
    this.lineSeries1.CoordinateSystem = this.cartesianCoordinateSystem1;
    this.lineSeries1.DataPointLabel = "=Fields.Label + \",\" + Sum(Fields.C)";
    this.lineSeries1.DataPointLabelStyle.Visible = true;
    this.lineSeries1.DataPointStyle.Visible = true;
    this.lineSeries1.LegendItem.Value = "C";
    this.lineSeries1.LineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(1D);
    this.lineSeries1.LineStyle.Visible = false;
    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.MarkerType = Telerik.Reporting.DataPointMarkerType.Circle;
    this.lineSeries1.Name = "lineSeries1";
    graphGroup3.Groupings.Add(new Telerik.Reporting.Grouping("=Fields.Label"));
    graphGroup3.Name = "labelGroup";
    graphGroup3.Sortings.Add(new Telerik.Reporting.Sorting("=Fields.Label", Telerik.Reporting.SortDirection.Asc));
    this.lineSeries1.SeriesGroup = graphGroup3;
    this.lineSeries1.Size = "=Sum(Fields.C)";
    this.lineSeries1.X = "=Sum(Fields.A)";
    this.lineSeries1.Y = "=Sum(Fields.B)";
    //
    // Report1
    //
    this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
    this.detailSection1});
    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;
    styleRule1.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
    new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.TextItemBase)),
    new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.HtmlTextBox))});
    styleRule1.Style.Padding.Left = Telerik.Reporting.Drawing.Unit.Point(2D);
    styleRule1.Style.Padding.Right = Telerik.Reporting.Drawing.Unit.Point(2D);
    this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] {
    styleRule1});
    this.Width = Telerik.Reporting.Drawing.Unit.Cm(17.799999237060547D);
    ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

    }
    #endregion

    private Telerik.Reporting.DetailSection detailSection1;
    private Telerik.Reporting.Graph graph1;
    private Telerik.Reporting.CartesianCoordinateSystem cartesianCoordinateSystem1;
    private Telerik.Reporting.GraphAxis graphAxis1;
    private Telerik.Reporting.GraphAxis graphAxis2;
    private Telerik.Reporting.CsvDataSource csvDataSource1;
    private Telerik.Reporting.LineSeries lineSeries1;

    }
    }


  2. Kenneth
    Kenneth avatar
    4 posts
    Member since:
    Aug 2011

    Posted 02 Oct 2014 Link to this post

    The version I'm using is 8.1 14.804 (Trial)
  3. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 07 Oct 2014 Link to this post

    Hello Kenneth,

    Currently the PloatAreaStyle.BackgroundImage is not applied and you will have to rely on the PlotAreaStyle.BackgroundColor and the graph's Style.BackgroundImage properties.

    It is logged in our system to verify all graph's Style objects apply properly. The current styling mechanism works per the diagram in the Style Resolving Fallback Algorithm article.


    I hope the above information is helpful.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top