0

Draggable points on zk chart 7.2.1.0

asked 2020-08-25 01:43:28 +0800

bztom35 gravatar image bztom35
103 4

How can I set chart series(2) data points draggable?

    chart.setModel(getData.getXYModel());
     chart.setWidth(width);
     chart.setHeight(height);
     chart.getSeries(0).setColor("red");
     chart.getSeries(1).setColor("blue");
     **chart.getSeries(2).setColor("green");**
delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
0
link publish delete flag offensive edit

Comments

Thank for your quick response. I was able to turn on the correct series for draggable point. However, is there a way to enable/disable the draggable point features dynamically? I don't want it enable all the time. It gets in the way of normal chart interaction.

bztom35 ( 2020-08-26 02:53:50 +0800 )edit
0

answered 2020-08-26 02:59:33 +0800

bztom35 gravatar image bztom35
103 4

updated 2020-08-26 10:23:07 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

I tried to enabled/disabled draggable, but it didn't do anything.

chart.addEventListener(Events.ON_CTRL_KEY , new EventListener()  {

        @Override
        public void onEvent(Event event) throws Exception {
            int keyCode = ((KeyEvent) event).getKeyCode();
            System.out.println("Key coded: " + keyCode);

            if (keyCode == 90){
                   System.out.println("Pressed Ctrl + z");
                   //enable drag and drop on Y axis.
                   chart.getSeries(2).getDragDrop().setDraggableY(true);

            }else {
                  //disabl drag and drop on Y axis.
               chart.getSeries(2).getDragDrop().setDraggableY(false);


            }

        } 
    });
link publish delete flag offensive edit

Comments

Because zkchart doesn't support ctrlKeys attribute, you need to implement other event listeners e.g. onClick event for a button to enable drag&drop

hawk ( 2020-08-26 10:33:24 +0800 )edit

Thanks! I guess I will use the button method and hopefully, the ctrlkeys attribute will be added in future releases.

bztom35 ( 2020-08-26 13:55:07 +0800 )edit
0

answered 2020-08-26 14:16:29 +0800

bztom35 gravatar image bztom35
103 4

updated 2020-08-26 14:16:49 +0800

Is there away to capture/display the new dragged y-axis values?

For example, when I dragged the original y-value from 100 to 150. The chart shows the correct value visually, but when I clicked on the newly dragged value, it was still the old value(100).

|             *                   (150)
|
|************* ****************** (100)
|
|
|_______________________________________
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2020-08-25 01:43:28 +0800

Seen: 12 times

Last updated: Aug 26 '20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More