Class SvgCharts
java.lang.Object
com.quantfinlib.report.SvgCharts
Dependency-free inline SVG charts for HTML reports: equity curves and
drawdown charts rendered as self-contained SVG strings (no external assets,
no JavaScript).
Why hand-rolled SVG and not a charting library: the report must open
identically in a browser, an email client, and an archive viewer ten
years from now — inline vector markup with no script and no fetch is the
only format with that guarantee, and it keeps the library's
zero-dependency promise. SVG is also resolution-independent (a compliance
PDF print at 300dpi stays sharp) and diff-able in version control.
Locale.US formatting throughout: an SVG coordinate written as
"1,5" by a German-locale JVM is the classic silently-blank-chart
bug. Output plugs into Report.Builder.addHtmlSection(java.lang.String, java.lang.String) and renders
via HtmlReportExporter only.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringdrawdownChart(double[] equity) Drawdown area chart (720x220): 0 at the top, drawdowns filled below.static StringequityChart(double[] equity) Equity curve line chart (720x300).static StringGeneric line chart of a value series.
-
Method Details
-
equityChart
Equity curve line chart (720x300). -
drawdownChart
Drawdown area chart (720x220): 0 at the top, drawdowns filled below. -
lineChart
-