Display chartimage in 2 places

Thread is closed for posting
5 posts, 1 answers
  1. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 03 May 2010 Link to this post

    I have a RadChart on a webpage.
    I want to display the same chart (image) in a RadWindow (popup).
    Is that possible without having to create a second RadChart control ?

    Yours
      Bjössi
  2. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 03 May 2010 Link to this post

    I found a solution that may not be perfect.
                        var img = document.getElementById("<%=RadChart1.ClientID %>").getElementsByTagName("img")[0];  
                        window.radopen("editProposal.aspx?ChartImage="+ encodeURIComponent(imgUrl) , "RadWindowEditProposal");  
                        return false;  
                     

    Yours,
        B
  3. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 18 May 2010 Link to this post

    It looks like that I'm the only one that is interested in this :-).

    My previous work-around has serious limitation.
    The scenario :
        A RadChart that displays detail info for the selected record in a RadGrid. The chart is updated on "onselectedindexchanged" in the grid. The record is edited in a RadWindow.  There it is helpful for the user to see the chart-image.
    However the chart hasn't always finished the refresh before the RadWindow opens and the previous chart-image is shown in the RadWindow.
    And before anyone points out that this can be prevented by edit button outside the grid so the user has to select before opening.
    That approach doesn't go well with our design.

    Thanks to everyone that has taken the time to read this.
    Yours
       Bjössi
    PS: I ended up putting second RadChart on the RadWindow, impact was less than expected.
  4. Answer
    Ves
    Admin
    Ves avatar
    2926 posts

    Posted 20 May 2010 Link to this post

    Hello Bjössi,

    An alternative approach would be to use the RadChart.Save method to save the chart to an image or a stream and use it as per your requirements. Yes, you can also use a second RadChart, in this case you may consider disabling its ViewState to improve the performance.

    Best regards,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 20 May 2010 Link to this post

    Thanks for the input.
       The .Save method is a better and more elegant solution than my first workaround.
    But it would still require some logic to ensure that the onselectedindexchanged server event has completed before the RadWindow is opened.

    Thanks for the ViewState observation I hadn't thought about that but will check it out.

    Yours
       Bjössi
Back to Top