Jump to content
JChartFX Community

Janusz

Members
  • Posts

    6
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Janusz

  1. Hi,

     

    i attach the click event as last action.

     

                    chart1.create("myjChartFX");

                    $(""myjChartFX").click(function (evt) {
                        alert(evt.series);
                        if (evt.hitType == cfx.HitType.Point)
                            alert("Series " + evt.series + " Point " + evt.point);
                    });

     

    as you suggest. 

    The click event will be fired, but as i described. The event will not get any info about series. evt.series and  evt.point are not defined.

  2. Hi,

     

    i tried to add "onClick" on a pie chart, like you described:

     

                    $("#myjChartFX").click(function (evt) {
                        if (evt.hitType == cfx.HitType.Point)
                            alert("Series " + evt.series + " Point " + evt.point);
                    });

     

    i'm using:

     

            <script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
            <script type="text/javascript" src="../js/jquery-ui.min.js"></script>
            <script type="text/javascript" src="./Resources/jchartfx.system.js"></script>  
            <script type="text/javascript" src="./Resources/jchartfx.coreVector.js"></script>
            <script type="text/javascript" src="./Resources/jchartfx.advanced.js"></script>
            <script type="text/javascript" src="./Resources/jchartfx.animation.js"></script>
            <script type="text/javascript" src="./Resources/jchartfx.userInterface.js"></script>

     

    unfortunately the evt.hitType is 0 and cfx.HitType.Point is 4. And also the evt.series and evt.point are undefined.

     

    I'm using your sample from the dowload zip with pie samples.

     

    i also tried to use the

            <script type="text/javascript" src="./resources/jquery-1.7.1.js"></script>
            <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
            <script type="text/javascript" src="http://www.jchartfx.com/libs/v7/current/js/jchartfx.full.js"></script>

     

    same result.

     

    my js:

                    var chart1 = new cfx.Chart();
                    var strTitle = "my sample"
                    chart1.setGallery(cfx.Gallery.Pie);
                    chart1.getAllSeries().getPointLabels().setVisible(true);
                    var pie = chart1.getGalleryAttributes();
                    pie.setExplodingMode(cfx.ExplodingMode.All);

                    PopulateData(chart1);
                    var fields = chart1.getDataSourceSettings().getFields();

                    var field1 = new cfx.FieldMap();
                    field1.setName("Region");
                    field1.setUsage(cfx.FieldUsage.RowHeading);
                    fields.add(field1);

                    var field2 = new cfx.FieldMap();
                    field2.setName("keyFigure");
                    field2.setUsage(cfx.FieldUsage.ColumnHeading);
                    fields.add(field2);

                    var fieldVal = new cfx.FieldMap();
                    fieldVal.setName("Usage");
                    fieldVal.setUsage(cfx.FieldUsage.Value);
                    fields.add(fieldVal);

                    var crosstab = new cfx.data.CrosstabDataProvider();
                    crosstab.setDataSource(chart1.getDataSource());
                    chart1.setDataSource(crosstab);

                    var data = chart1.getData();
                    data.setSeries(1);

                    var titles = chart1.getTitles();
                    var title = new cfx.TitleDockable();
                    title.setText(strTitle);
                    titles.add(title);

                    chart1.getAllSeries().getPointLabels().setVisible(true);
                    chart1.getAllSeries().getPointLabels().setAlignment(cfx.StringAlignment.NEAR);
                    chart1.getAnimations().getLoad().setEnabled(true);

                    chart1.create("myjChartFX");

     

     

    i'll be grateful for any help :-)

     

×
×
  • Create New...