New Window with SeriesHotSpot-Tool

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Woehr.Mi
Newbie
Newbie
Posts: 38
Joined: Mon Jun 23, 2008 12:00 am

New Window with SeriesHotSpot-Tool

Post by Woehr.Mi » Tue Mar 10, 2009 8:29 am

Hello,

I'm using the TeeChart-Webchart in my current project with a SeriesHotspot-Tool. The MapAction property of the HotSpot-Tool is set to MapAction.URL, to open a PopupWindow by clicking a Series in my Webchart. In the tutorial I found an example where the Attributes-Property is set to "target='_blank'". Is there any possibility to set more properties of the PopUp-Window like Menubar=no, Resizeable=no, Statusbar=no or have I to do this in Javascript for example.

Best Regards.
Michael

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Tue Mar 10, 2009 12:47 pm

Hi Michael,

I suggest a solution of your question. I divided solution in 2 parts:

First:
In GetHTMLMap event you have do similar code as next:

InitializeChart:

Code: Select all

  private void InitializeChart()
    {
        Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(WebChart1.Chart);
        bar1.FillSampleValues();
        Steema.TeeChart.Tools.SeriesHotspot hotSpot1 = new Steema.TeeChart.Tools.SeriesHotspot(WebChart1.Chart);
        hotSpot1.MapAction = Steema.TeeChart.Styles.MapAction.URL;
        hotSpot1.GetHTMLMap += new Steema.TeeChart.Tools.SeriesHotspotEventHandler(_Default_GetHTMLMap);

    }



GetHTMLMAP event:

Code: Select all

  void _Default_GetHTMLMap(Steema.TeeChart.Tools.SeriesHotspot sender, Steema.TeeChart.Tools.SeriesHotspotEventArgs e)
    {
        String myVar1 = "http://www.gmail.com";
        String myVar2 = "myName";
        e.PointPolygon.Attributes = "onclick=TestF('" + myVar1 + "','" + myVar2 + "')";
    }

Second:
You needs to add,of your tChart, the similar html code as next example:

Html code add:

Code: Select all

<head runat="server">
    <title>Untitled Page</title>
    
<script language=javascript>

function TestF(URL,windowName)
{
  window.open(URL,windowName,'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=509,height=275')
}

</script>    
</head>

I hope that will help you.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Woehr.Mi
Newbie
Newbie
Posts: 38
Joined: Mon Jun 23, 2008 12:00 am

Post by Woehr.Mi » Wed Mar 11, 2009 1:44 pm

Hi Sandra.

Thanks for the code-example.
Now it works the way I want.

Best regards
Michael

Post Reply