Skip to content

Charts and SVG theming

Navapatra draws charts on the server and returns plain SVG. There is no chart library to install and nothing to compute in the browser; you drop the SVG into the page and style it with CSS.

Birth chart, North Indian styleLagna in sign 9. Sun in house 9 (sign 5, 11°). Moon in house 1 (sign 9, 29°). Mars in house 10 (sign 6, 16°). Mercury in house 9 (sign 5, 10°). Jupiter in house 10 (sign 6, 20°). Venus in house 8 (sign 4, 7°). Saturn in house 3 (sign 11, 2°), retrograde. Rahu in house 12 (sign 8, 13°), retrograde. Ketu in house 6 (sign 2, 13°), retrograde.910111212345678AscMoSaRKeRVeSuMeMaJuRaR
style: "north"
Birth chart, South Indian styleLagna in sign 9. Sun in house 9 (sign 5, 11°). Moon in house 1 (sign 9, 29°). Mars in house 10 (sign 6, 16°). Mercury in house 9 (sign 5, 10°). Jupiter in house 10 (sign 6, 20°). Venus in house 8 (sign 4, 7°). Saturn in house 3 (sign 11, 2°), retrograde. Rahu in house 12 (sign 8, 13°), retrograde. Ketu in house 6 (sign 2, 13°), retrograde.123456789101112AscKeRVeSuMeMaJuRaRMoSaR
style: "south"
Birth chart, North Indian styleLagna in sign 9. Sun in house 9 (sign 5, 11°). Moon in house 1 (sign 9, 29°). Mars in house 10 (sign 6, 16°). Mercury in house 9 (sign 5, 10°). Jupiter in house 10 (sign 6, 20°). Venus in house 8 (sign 4, 7°). Saturn in house 3 (sign 11, 2°), retrograde. Rahu in house 12 (sign 8, 13°), retrograde. Ketu in house 6 (sign 2, 13°), retrograde.910111212345678AscMoSaRKeRVeSuMeMaJuRaR
north, custom --kc-* values

These are real responses for the Pokhara sample, themed live by this page’s CSS.

POST/v1/charts/svg1 creditReference

Send either birth (computed for you) or kundali (a payload you already have from /v1/kundali or /v1/kundali/planets, of which only the lagna and graha longitudes are read). Exactly one of the two.

Terminal window
curl https://api.navapatra.com/v1/charts/svg \
-H "Authorization: Bearer $NAVAPATRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"birth": { "calendar": "BS", "date": "2050-05-12", "time": "14:35", "place": { "lat": 28.2096, "lng": 83.9856 } },
"style": "north",
"chart": "D1",
"lang": "ne"
}' \
-o chart.svg
Field Values Default
style north (diamond houses, fixed houses) or south (square, fixed signs) north
chart D1 or D9 D1
lang, numerals Labels and digits inside the chart en, then by language
options.showDegrees Adds each graha’s degree in its sign (D1 only) false
options.size Width and height in pixels, 100 to 2000 400
options.ayanamsha, nodeType, … The usual chart options, for birth input

The response is image/svg+xml, or JSON { "svg", "style", "chart" } when you send Accept: application/json. To get charts alongside a kundali in one call, use include: ["svg"] (North) or ["svg.south"] (both) on /v1/kundali; those are D1 charts.

Charts made on the free plan or the Starter pack carry a small “Powered by Navapatra” line in the bottom corner. Growth, Scale and Volume packs, annual and enterprise plans do not. An org that holds Starter and a larger pack gets the larger pack’s charts.

Every colour and font in the SVG reads a CSS custom property, with a sensible fallback. Set them on the SVG or any ancestor:

Variable Used for Fallback
--kc-bg Chart background transparent
--kc-house-bg House fill transparent
--kc-line House lines grey
--kc-text Graha labels currentColor
--kc-muted Sign numbers, degrees, watermark grey
--kc-accent Lagna label and marker vermilion
--kc-accent-soft Lagna house fill translucent vermilion
--kc-font Text inherited
--kc-font-mono Degrees ui-monospace
/* Match the chart to your design tokens. */
.kc-root {
--kc-line: var(--border-strong);
--kc-text: var(--text);
--kc-muted: var(--text-3);
--kc-accent: var(--accent-text);
--kc-accent-soft: var(--accent-soft);
--kc-font: var(--font-sans);
--kc-font-mono: var(--font-mono);
}

Because the variables resolve in your page, the same SVG follows your light and dark themes with no extra request.

For anything variables cannot do, target the elements directly:

Selector Element
.kc-root The <svg>, also .kc-north or .kc-south
.kc-house, .kc-house-1 to .kc-house-12 House polygons; .kc-lagna-house marks house 1
.kc-lines The chart’s line drawing
.kc-sign Sign numbers
.kc-graha, .kc-graha-sun … .kc-graha-ketu Graha labels
.kc-retro The retrograde marker
.kc-degree Degrees, with showDegrees
.kc-lagna, .kc-lagna-label, .kc-lagna-mark The lagna label and its marker
.kc-watermark The “Powered by” line (free plan and Starter pack)

Houses, signs and grahas also carry data-house, data-sign and data-graha (and data-retrograde="true"), which makes it easy to add hover states or tooltips:

.kc-house:hover { fill: var(--accent-soft); }
.kc-graha[data-retrograde='true'] { font-style: italic; }

Each SVG has role="img" with a <title> (for example “Birth chart, North Indian style”) and a <desc> that lists the lagna and every graha’s house and sign, so screen readers get the whole chart as text. Labels use the lang you requested, and the <svg> carries a matching lang attribute.

The SVG contains no scripts, links or external references. You can inline it with innerHTML or serve it as an image. Each chart’s internal ids are unique to its content, so several charts can sit on one page. For interactive charts with tooltips and keyboard navigation, use the <kundali-chart> widget.