TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Chart.xkcd – Xkcd-styled chart library

435 pointsby timqianalmost 6 years ago

16 comments

sheetjsalmost 6 years ago
For general SVG &quot;sketchy&quot; effect, Rough.js is a very cool library: <a href="https:&#x2F;&#x2F;roughjs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;roughjs.com&#x2F;</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;pshihn&#x2F;rough&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pshihn&#x2F;rough&#x2F;</a><p><a href="https:&#x2F;&#x2F;roughjs.com&#x2F;examples&#x2F;bar-chart.html" rel="nofollow">https:&#x2F;&#x2F;roughjs.com&#x2F;examples&#x2F;bar-chart.html</a> is an example of a bar chart built up with D3<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16571827" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16571827</a> was the discussion when it was first submitted
timqianalmost 6 years ago
Hi, HN, thanks for the upvotes. I am the author of this lib.<p>What I want is a chart library with simple API like chart.js but in hand-drawn effect. I find there is no such lib, so I created this one. Thanks for trying it out.<p>Previous discussions about xkcd styled charts:<p>- xkcd styled charts in matplotlib: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19293129" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19293129</a><p>- simple line graph in d3: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4671676" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4671676</a><p>- disscussions on stackexchange: <a href="https:&#x2F;&#x2F;mathematica.stackexchange.com&#x2F;questions&#x2F;11350&#x2F;xkcd-style-plots" rel="nofollow">https:&#x2F;&#x2F;mathematica.stackexchange.com&#x2F;questions&#x2F;11350&#x2F;xkcd-s...</a><p>- why are xkcd styled graph important: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7511762" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7511762</a>
评论 #20743449 未加载
评论 #20739110 未加载
评论 #20735984 未加载
yoz-yalmost 6 years ago
Looks cool! On safari in Codepen it does not render any lines though, only text is visible.
评论 #20736767 未加载
SimeVidasalmost 6 years ago
Almost 1 MB of JavaScript transferred to render a single chart? I am afraid that is not acceptable. I mean no disrespect whatsoever to the author of the library, but sending that amount of JS for a single component is just outside of any reasonable performance budget.<p>That being said, a server-side or build-step tool that generates lean SVG code? Yes, please.
评论 #20742411 未加载
评论 #20747830 未加载
评论 #20739821 未加载
risubramanianalmost 6 years ago
Matplotlib has this too!<p><a href="https:&#x2F;&#x2F;matplotlib.org&#x2F;3.1.1&#x2F;api&#x2F;_as_gen&#x2F;matplotlib.pyplot.xkcd.html" rel="nofollow">https:&#x2F;&#x2F;matplotlib.org&#x2F;3.1.1&#x2F;api&#x2F;_as_gen&#x2F;matplotlib.pyplot.x...</a>
评论 #20736881 未加载
deweyalmost 6 years ago
There’s also a D3 version already that also has a hosted version:<p><a href="http:&#x2F;&#x2F;xkcdgraphs.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;xkcdgraphs.com&#x2F;</a>
评论 #20735296 未加载
yubioxalmost 6 years ago
I see how to provide the Y axis data for the labels but is there a way to use X labels like 1 2 3 but then provide (X,Y) coords for minima and maxima [(1.1, 3.2), (4.8, 7.5), (6.3, 2.4), (8.2, 7.3)] and get a curve?
评论 #20735910 未加载
samch93almost 6 years ago
Also an R package exists to do this on top of ggplot2: <a href="http:&#x2F;&#x2F;xkcd.r-forge.r-project.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;xkcd.r-forge.r-project.org&#x2F;</a>
DangerousPiealmost 6 years ago
Looks nice but why create a whole new plotting library for this rather than adding it to one of the existing ones (eg. Chart.js)?
评论 #20736760 未加载
askoshalmost 6 years ago
This is super cool! Amazing work.
imdsmalmost 6 years ago
I love this, for the reasons laid out in this article (which I always back to):<p><a href="https:&#x2F;&#x2F;www.chrisstucchio.com&#x2F;blog&#x2F;2014&#x2F;why_xkcd_style_graphs_are_important.html" rel="nofollow">https:&#x2F;&#x2F;www.chrisstucchio.com&#x2F;blog&#x2F;2014&#x2F;why_xkcd_style_graph...</a>
dedoskalmost 6 years ago
What is the license of the library?
评论 #20735967 未加载
评论 #20735647 未加载
surajsalmost 6 years ago
beautiful, starred.
dintechalmost 6 years ago
Really nice
bythckralmost 6 years ago
isn&#x27;t comic sans the xkcd font?
JulianMorrisonalmost 6 years ago
Turning something witty&#x2F;insightful into an automated cliche is not an improvement.
评论 #20736638 未加载