我正在为Angular 2应用程序利用以下ChartJS框架:
https://github.com/valor-software/ng2-charts
我希望做到以下几点:
#include <stdio.h>
void insert(int val, int *n, int v[])
{
int index;
index = n - 1;
if (n == 0)
{
v[0] = val; // check if array is empty
n = n + 1; // v[0] becomes the given value
} // increase size of array
if (val > v[index])
{
v[index+1] = val; // given value is bigger than the last value in array
n = n + 1; // increase size
}
else
{
while (index >= 0 && v[index] > val)
{
v[index+1] = v[index]; //shift items to the right
index--;
}
v[index + 1] = val; //after moving elements to the right
n = n + 1; // i set the value to the valid position
}
}
void display(int n, int v[])
{
int i;
for (i = 0;i < n; i++)
printf("%d ", v[i]);
}
int main(void)
{
int v[10] = { 12, 23, 34, 41, 69, 71, 81, 91, 100 };
int n;
n = 9; // size of array
insert(101,n,v); // 101 is given value to insert
display(n,v);
return 0;
}
标记。 <canvas></canvas>
和/或chartHover
事件。 理想情况下,我希望用户将鼠标悬停在任一图表上,但共享相同的互动。例如,如果用户将鼠标悬停在条形图上,条形图和折线图上都会出现一条垂直线(反之亦然)。