尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證MIT-licensed C++17 charting library: PNG/JPEG, native vector SVG and PDF, no GUI toolkit, OpenWrt-friendly
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Native C++17 charts for reports and embedded devices.
PNG, JPEG, and native vector SVG and PDF from one call. MIT-licensed, no GUI toolkit, no Python.檢視完整 README ↗InsightDock Charts is static output only. For interactive zoom and pan use QCustomPlot, ImPlot or Qt Charts. See the honest comparison.
#include "insightdock/charts.h"
using namespace insightdock::charts;
BarChart bar;
bar.options().title = "Quarterly Revenue";
bar.set_categories({"Q1", "Q2", "Q3", "Q4"});
bar.add_series("Revenue", {100, 120, 90, 140});
bar.add_series("Cost", {60, 70, 65, 80});
ChartExporter::save(bar, "revenue.png"); // format inferred from the extension
Native vector output:
ExportOptions opts;
opts.svg_backend = SvgBackend::Vector; // SVG: no dependencies
opts.pdf_backend = PdfBackend::Vector; // PDF: needs INSIGHTDOCK_WITH_PODOFO
ChartExporter::save(bar, "revenue.svg", opts);
ChartExporter::save(bar, "revenue.pdf", opts);
Link it from CMake:
find_package(InsightDock CONFIG REQUIRED)
target_link_libraries(myapp PRIVATE InsightDock::Charts)
See examples/ for pie, bar, line, combo, scatter, log-scale, time-series and PDF report samples.
ChartOptions::fontImageBuffer; multi-page PDF report builder (PoDoFo)render()/save() on a const chart is supported| Pie | Bar (stacked) | Area (stacked) |
|---|---|---|
| Combo (bar + line, dual axis) | Vector PDF vs Matplotlib |
|---|---|
More in docs/gallery/.
├── include/insightdock/ Public headers (charts.h umbrella)
│ └── pdf/ PoDoFo PDF helpers (podofo.h)
├── src/ Library implementation
├── examples/ Generic sample programs
├── tests/ CTest smoke tests
├── third_party/ stb headers (header-only)
├── docs/ API, release, gallery, benchmarks
└── cmake/ Package config for install
Best for OpenWrt and minimal embedded builds:
make
./bar_line_example
./example_main
Three variables let you trim the library for size-constrained targets:
| Variable | Default | Options | Effect |
|---|---|---|---|
CHART_TYPES | pie bar line area scatter | any subset (bar+line also builds combo) | Omitted types are not compiled |
EXPORT_FORMATS | png jpeg | png or png jpeg | Omitting jpeg drops ~15 KB |
FONT_MODE | embedded | embedded | embedded-latin | system | embedded-latin adds Latin-1/Latin-Ext glyphs (~22 KB); system drops the baked-in font |
Minimal OpenWrt build (pie only, PNG only, system font from /www/assets/):
make CXX=mips-openwrt-linux-musl-g++ AR=mips-openwrt-linux-musl-gcc-ar \
CHART_TYPES="pie" EXPORT_FORMATS="png" FONT_MODE=system \
CXXFLAGS="-std=c++17 -Os -ffunction-sections -fdata-sections -Wall"
When FONT_MODE=system, no font is baked in, so supply one on every chart:
static auto font = insightdock::charts::load_font_data("/www/assets/fonts/OpenSans-Regular.ttf");
chart.options().font = font; // shared_ptr — reuse it across charts
| Configuration | Code section (unstripped) |
|---|---|
| Full default (all types, embedded font, JPEG) | ~287 KB |
| Minimal (pie + PNG + system font) | ~90 KB |
Minimal with -Os -s strip (estimated) | ~45–55 KB |
Cross-compile (full build):
make CXX=mips-openwrt-linux-musl-g++ AR=mips-openwrt-linux-musl-gcc-ar
Packaging this into an OpenWrt feed: packaging/openwrt/ has a standard
package.mk-based feed Makefile sample wired to these same CHART_TYPES/EXPORT_FORMATS/
FONT_MODE knobs.
cmake -B build \
-DINSIGHTDOCK_BUILD_EXAMPLES=ON \
-DINSIGHTDOCK_BUILD_TESTS=ON
cmake --build build
ctest --test-dir build
| Option | Default | Description |
|---|---|---|
INSIGHTDOCK_BUILD_EXAMPLES | ON | Build generic examples |
INSIGHTDOCK_WITH_PODOFO | OFF | PDF adapter + PDF examples |
INSIGHTDOCK_BUILD_TESTS | ON | CTest smoke tests |
INSIGHTDOCK_WERROR | OFF | -Werror (keep OFF for cross-toolchains) |
INSIGHTDOCK_PODOFO_DIR | ../podofo | PoDoFo source tree (subproject) or install |
PoDoFo requires CMake 3.23+. On older systems:
pip install --user 'cmake>=3.23'
export PATH="$HOME/.local/bin:$PATH"
cmake -B build-podofo \
-DINSIGHTDOCK_WITH_PODOFO=ON \
-DINSIGHTDOCK_BUILD_EXAMPLES=ON \
-DINSIGHTDOCK_PODOFO_DIR=/path/to/podofo
cmake --build build-podofo
export LD_LIBRARY_PATH="$(pwd)/build-podofo/podofo/target:${LD_LIBRARY_PATH}"
./build-podofo/podofo_report_example
cmake --install build --prefix /opt/insightdock
find_package(InsightDock CONFIG REQUIRED)
target_link_libraries(myapp PRIVATE InsightDock::Charts)
#include "insightdock/charts.h"
A pkg-config file (insightdock.pc) is also installed to lib/pkgconfig/, for Meson or
plain-Makefile consumers:
export PKG_CONFIG_PATH="/opt/insightdock/lib/pkgconfig:${PKG_CONFIG_PATH}"
g++ -std=c++17 $(pkg-config --cflags insightdock) myapp.cc -o myapp $(pkg-config --libs insightdock)
The .pc file resolves paths relative to its installed location, including installations made
with cmake --install --prefix. For PDF-enabled builds, pkg-config also requires libpodofo.pc.
For static linking, use pkg-config --static --cflags --libs insightdock and put source/object
files before library flags on the linker command line.
| Platform | Core (PNG/JPEG) | PDF (PoDoFo) |
|---|---|---|
| Linux distros | Yes (CMake + Make) | Yes (optional) |
| OpenWrt / cross | Yes (Make, no GUI deps) | Yes — verified on OpenWrt x86_64/musl, BUILD_SHARED_LIBS=ON with PoDoFo packaged separately |
| macOS | CMake (CI) | Optional |
| Windows | CMake + MSVC (CI; static and DLL) | Optional |
The full documentation is at https://aavazir.github.io/insightdock-charts/: getting started, concepts, guides (usage, vector export, PDF reports, fonts, thread safety and ABI, troubleshooting), one page per chart type, examples, the generated API reference, a comparison and the changelog.
In the repository: docs/API.md (usage guide), docs/BENCHMARKS.md, docs/RELEASE.md, ROADMAP.md.
Bug reports, feature requests and new chart types are welcome. Read CONTRIBUTING.md and GOVERNANCE.md; this project follows a Code of Conduct. Report security issues privately as described in SECURITY.md.