Legend Disappears on Postback

Thread is closed for posting
8 posts, 0 answers
  1. John
    John avatar
    41 posts
    Member since:
    Nov 2007

    Posted 14 Mar 2008 Link to this post

    Hi,
    Im using Promethus RAD chart. In my user control, I have three charts which are dynamically binding and im having different legend for different charts.

    In my ascx, i have this much code and im doing all the things in code behind.

    <telerik:radchart ID="RadChart1" SkinsOverrideStyles="false" runat="server" Width="600px" Height="430px" seriespalette="" visible="false" >

    <PlotArea>

    <Appearance dimensions-width="470" > </Appearance>

    </PlotArea>
    </telerik:radchart>
    Legend Creation in code behind:

    Dim lbl1 As New LabelItem

    With RadChart1.Legend.Items(0)

    .TextBlock.Text =

    "81 to 100% - Appraisal criteria fully met"

    .Marker.Appearance.FillStyle.MainColor = Drawing.Color.Green

    .Marker.Appearance.FillStyle.SecondColor = Drawing.Color.GreenYellow

    .TextBlock.Appearance.TextProperties.Color = Color.Black

    End With

    Dim lbl2 As New LabelItem

    With RadChart1.Legend.Items(1)

    .TextBlock.Text =

    "41 to 80% - Appraisal criteria partially met"

    .Marker.Appearance.FillStyle.MainColor = Drawing.Color.Yellow

    .Marker.Appearance.FillStyle.SecondColor = Drawing.Color.Silver

    End With

    With RadChart1.Legend

    .AddLabel(lbl1)
     .AddLabel(lbl2)

    .Appearance.Position.AlignedPosition = Styles.AlignedPositions.BottomLeft

    .Appearance.Location = Styles.LabelLocation.OutsidePlotArea

    RadChart1.Legend.Visible =

    True

    End With

    IN the ascx control, i have combo box with the chart types... when the user changes the chart type and click refresh , then the next chart is loaded. but when the user just changes the chart type alone, then nothing should happen.

    actual result :  when the user changes the chart type, chart remains the same..but legend text and marker diasppears completely leaving blank white space. but when i click refresh, then legend comes properly.

    Is there a way to keep the legend as it is when the user changes the chart type in combo box.

    Could you pls.

    Thanks

  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 18 Mar 2008 Link to this post

    Hello Bidan,

    It seems, you have hit a bug in RadChart - custom legend item properties are lost on postback. I have notified our developers of this issue. We are sorry for the inconvenience caused. For the time being - you need to make sure that the legend item's properties are set each time the chart is shown in the page.

    Your Telerik points have been updated.

    Greetings,
    Ves
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. jjroman
    jjroman avatar
    6 posts
    Member since:
    Mar 2007

    Posted 10 Jun 2008 Link to this post

    Hi, Has this bug been fixed? I have a similar error: the first time (not postback) my labels are ok but after postback i have only labels with the names: item 1, item 2. I refresh my chart control but I think it lost the name of the items. I refresh the control with the next function:

    Private Sub InitRadChart2()

    Dim dr As SqlDataReader = Siprodata.getReporte1ForChart(ddMeses.SelectedValue, Session("UsuarioCodigoSiprodata"))

    'RadChart2.DataGroupColumn = "Monto"

    RadChart2.DataManager.LabelsColumn =

    "Operaciones"

    ' Set the series type

    RadChart2.DefaultType = Telerik.Charting.ChartSeriesType.Pie

    ' Set the data source

    RadChart2.DataSource = dr

    ' Refresh data

    RadChart2.DataBind()

    'RadChart2.Series(0).Appearance.ShowLabels = True

    'RadChart2.Series(0).DefaultLabelValue = "#ITEM #%"

    '' Asignando el formato de las etiquetas

    For Each it As ChartSeriesItem In RadChart2.Series(0).Items

    it.Label.TextBlock.Text =

    "#ITEM (#%)"

    Next

    'Set additional chart properties and settings.

    RadChart2.ChartTitle.TextBlock.Text =

    "Operaciones en el mes: " + ddMeses.SelectedItem.Text

    End Sub 'InitRadChart2

  4. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 11 Jun 2008 Link to this post

    Hello jjroman,

    I am afraid this code does not show any possible reason for such behavior. Can you please send us in a formal support ticket a small runnable page which reproduces the issue? You can replace the datareader with a datatable. Thanks.

    Regards,
    Ves
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Lance
    Lance avatar
    8 posts
    Member since:
    Nov 2008

    Posted 08 Jan 2010 Link to this post

    I too am experiencing these symptoms; this time with the skin, and the appearance.emptyvalue.line.color settings.  Can you verify if this is a bug for these specific settings?  This is on 2009 Q3 SP1.
  6. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 13 Jan 2010 Link to this post

    Hello Lance,

    Yes, the same issue exists for the EmptyValue settings. Make sure you retrieve and configure the correct series on each postback.

    Regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Katie Arnott
    Katie Arnott avatar
    25 posts
    Member since:
    Dec 2009

    Posted 05 Feb 2010 Link to this post

    custom legend item properties are lost on postback.

    has this issue been fixed?  I am too experiencing the disappearing of my legend text on postback, although it is being set every time.

    Thank you,
    Katie
  8. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 09 Feb 2010 Link to this post

    Hi Katie,

    I am afraid this has not been fixed. Can you send us an example, showing the issue with disappearing legend items, even though they are generated on each postback. We will review it and will get back to you with our findings. Thanks.


    Best regards,
    Ves
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top