Page MenuHomePhabricator

Display data points without connecting line in MitkChart
Closed, ResolvedPublic

Event Timeline

Try https://stackoverflow.com/questions/29150816/c3-js-making-line-appear-dashed

Instead of dashed line, make line invisible:

c3-line.lineoff {visibility:hidden;}

Works on fiddle: http://jsfiddle.net/azurelogic/wn3vzn0k/

Javascript:

var hideLine = true;
var targetClass = "";
if (hideLine==true){
		targetClass = 'lineoff';
}
else{
	targetClass = 'show';
}

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250]
        ], 
        classes: {  
        		data1: targetClass
      }
    }
});

CSS:

.c3-target-lineoff{
    stroke-dasharray: 0,5;
}

.c3-target-show{
    stroke-dasharray: 5,5;
}

TODO:

  • get dataName ('data1') from data
  • implement function in MITK

TODO:

  • ... and edit default lineName to .c3-target-line in Chart.css

@klein You are currently working on this, right?

@vemuri and I integrated the proposal by @laha and @hempe.
The solution needs to be tested with multiple data lines. We tested it within the Image statistics plugin and it worked.

Instead of hiding the line one could just use a scatter plot... I will look into this next time