我试图使用Chart.js填充折线图中两行之间的区域.像这样:
已经有一个答案在这里,解释如何扩展chartjs做到这一点.但是我知道这个功能现在是V2中的本机(来自github问题页面上的这个线程),问题是我找不到引用此文档的文档.
在doc中是否有关于此的部分?有谁知道如何使用此功能?
谢谢!
我有这个结构:
typedef struct chunk
{
int size;
int available;
struct chunk* next;
} chunk;
Run Code Online (Sandbox Code Playgroud)
我初始化一个节点这样做:
chunk* head, ptr;
chunk* node = (chunk*) brkOrigin;
node->size = alloc - sizeof(chunk);
node->available = 1;
node->next = NULL;
Run Code Online (Sandbox Code Playgroud)
我没有使用malloc(),因为这是一个我必须实现myMalloc()的赋值,所以brkOrigin是我在使用sbrk()之前的一个地址,在那段代码之前.这就是为什么我使用这个直接地址而不是malloc().但是我不知道这样做是否正确,如果有人知道如何在没有malloc()的情况下初始化一个喜欢列表的节点,它也会很好.
但是我必须搜索链表,尝试这个时我遇到了一些错误:
head = node;
ptr = head;
while(ptr != NULL)
{
if(ptr->size >= mem && ptr->available == 1)
{
ptr->available = 0;
if(ptr->size > mem)
{
//Split in two nodes. Basically, create another with the remainder of memory.
}
}
else
ptr = ptr->next;
} …Run Code Online (Sandbox Code Playgroud) c ×1
chart.js ×1
html5 ×1
html5-canvas ×1
javascript ×1
linked-list ×1
malloc ×1
pointers ×1
struct ×1