Properly calculating matrix and handling click on tooltip only in the LineChart.