/usr/share/doc/libghc-chart-doc/html/Chart.txt is in libghc-chart-doc 1.5.4-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A library for generating 2D Charts and Plots
--
-- A library for generating 2D Charts and Plots, with backends provided
-- by Cairo (<a>http://hackage.haskell.org/package/Chart-cairo</a>) and
-- Diagrams (<a>http://hackage.haskell.org/package/Chart-diagrams</a>).
@package Chart
@version 1.5.4
module Numeric.Histogram
type Range a = (a, a)
-- | 'binBounds a b n' generates bounds for <tt>n</tt> bins spaced linearly
-- between <tt>a</tt> and <tt>b</tt>
binBounds :: RealFrac a => a -> a -> Int -> [Range a]
-- | 'histValues a b n vs' returns the bins for the histogram of
-- <tt>vs</tt> on the range from <tt>a</tt> to <tt>b</tt> with <tt>n</tt>
-- bins
histValues :: RealFrac a => a -> a -> Int -> [a] -> Vector (Range a, Int)
-- | 'histValues a b n vs' returns the bins for the weighted histogram of
-- <tt>vs</tt> on the range from <tt>a</tt> to <tt>b</tt> with <tt>n</tt>
-- bins
histWeightedValues :: RealFrac a => a -> a -> Int -> [(Double, a)] -> Vector (Range a, Double)
-- | 'histWithBins bins xs' is the histogram of weighted values <tt>xs</tt>
-- with <tt>bins</tt>
histWithBins :: (Num w, RealFrac a) => Vector (Range a) -> [(w, a)] -> Vector (Range a, w)
-- | Non chart specific utility functions.
module Graphics.Rendering.Chart.Utils
-- | Checks if the given value is and actual numeric value and not a
-- concept like NaN or infinity.
isValidNumber :: (RealFloat a) => a -> Bool
-- | Version of <a>maybe</a> that returns a monadic value.
maybeM :: (Monad m) => b -> (a -> m b) -> Maybe a -> m b
module Graphics.Rendering.Chart.Geometry
-- | A rectangle is defined by two points.
data Rect
Rect :: Point -> Point -> Rect
-- | A point in two dimensions.
data Point
Point :: Double -> Double -> Point
[p_x] :: Point -> Double
[p_y] :: Point -> Double
-- | A vector in two dimensions.
data Vector
Vector :: Double -> Double -> Vector
[v_x] :: Vector -> Double
[v_y] :: Vector -> Double
type RectSize = (Double, Double)
type Range = (Double, Double)
-- | Convert a <a>Point</a> to a <a>Vector</a>.
pointToVec :: Point -> Vector
-- | Create a rectangle based upon the coordinates of 4 points.
mkrect :: Point -> Point -> Point -> Point -> Rect
-- | Make a path from a rectangle.
rectPath :: Rect -> Path
-- | Add a point and a vector.
pvadd :: Point -> Vector -> Point
-- | Subtract a vector from a point.
pvsub :: Point -> Vector -> Point
-- | Subtract two points.
psub :: Point -> Point -> Vector
-- | Angle of a vector (counterclockwise from positive x-axis)
vangle :: Vector -> Double
-- | Length/magnitude of a vector
vlen :: Vector -> Double
-- | Scale a vector by a constant.
vscale :: Double -> Vector -> Vector
-- | Test if a point is within a rectangle.
within :: Point -> Rect -> Bool
-- | Intersects the rectangles. If they intersect the intersection
-- rectangle is returned. <a>LMin</a> is the empty rectangle /
-- intersection and <a>LMax</a> is the infinite plane.
intersectRect :: Limit Rect -> Limit Rect -> Limit Rect
-- | Edge of a rectangle.
data RectEdge
E_Top :: RectEdge
E_Bottom :: RectEdge
E_Left :: RectEdge
E_Right :: RectEdge
data Limit a
LMin :: Limit a
LValue :: a -> Limit a
LMax :: Limit a
-- | A function mapping between points.
type PointMapFn x y = (Limit x, Limit y) -> Point
-- | The path type used by Charts.
--
-- A path can consist of several subpaths. Each is started by a
-- <a>MoveTo</a> operation. All subpaths are open, except the last one,
-- which may be closed using the <a>Close</a> operation. When filling a
-- path all subpaths are closed implicitly.
--
-- Closing a subpath means that a line is drawn from the end point to the
-- start point of the subpath.
--
-- If a <a>Arc</a> (or <a>ArcNeg</a>) is drawn a implicit line from the
-- last end point of the subpath is drawn to the beginning of the arc.
-- Another implicit line is drawn from the end of an arc to the beginning
-- of the next path segment.
--
-- The beginning of a subpath is either (0,0) or set by a <a>MoveTo</a>
-- instruction. If the first subpath is started with an arc the beginning
-- of that subpath is the beginning of the arc.
data Path
MoveTo :: Point -> Path -> Path
LineTo :: Point -> Path -> Path
Arc :: Point -> Double -> Double -> Double -> Path -> Path
ArcNeg :: Point -> Double -> Double -> Double -> Path -> Path
End :: Path
Close :: Path
-- | Move the paths pointer to the given location and draw a straight line
-- while doing so.
lineTo :: Point -> Path
-- | Move the paths pointer to the given location.
moveTo :: Point -> Path
-- | Short-cut for <a>lineTo</a>, if you don't want to create a
-- <a>Point</a>.
lineTo' :: Double -> Double -> Path
-- | Short-cut for <a>moveTo</a>, if you don't want to create a
-- <a>Point</a>.
moveTo' :: Double -> Double -> Path
-- | Draw the arc of a circle. A straight line connects the end of the
-- previous path with the beginning of the arc. The zero angle points in
-- direction of the positive x-axis. Angles increase in clock-wise
-- direction. If the stop angle is smaller then the start angle it is
-- increased by multiples of <tt>2 * pi</tt> until is is greater or
-- equal.
arc :: Point -> Double -> Double -> Double -> Path
-- | Short-cut for <a>arc</a>, if you don't want to create a <a>Point</a>.
arc' :: Double -> Double -> Double -> Double -> Double -> Path
-- | Like <a>arc</a>, but draws from the stop angle to the start angle
-- instead of between them.
arcNeg :: Point -> Double -> Double -> Double -> Path
-- | Short-cut for <a>arcNeg</a>, if you don't want to create a
-- <a>Point</a>.
arcNeg' :: Double -> Double -> Double -> Double -> Double -> Path
-- | A closed empty path. Closes a path when appended.
close :: Path
-- | Fold the given path to a monoid structure.
foldPath :: (Monoid m) => (Point -> m) -> (Point -> m) -> (Point -> Double -> Double -> Double -> m) -> (Point -> Double -> Double -> Double -> m) -> m -> Path -> m
-- | Enriches the path with explicit instructions to draw lines, that
-- otherwise would be implicit. See <a>Path</a> for details about what
-- lines in paths are implicit.
makeLinesExplicit :: Path -> Path
-- | Transform a point using the given matrix.
transformP :: Matrix -> Point -> Point
-- | Scale a point.
scaleP :: Vector -> Point -> Point
-- | Rotate a point around the origin. The angle is given in radians.
rotateP :: Double -> Point -> Point
-- | Translate a point.
translateP :: Vector -> Point -> Point
-- | Copied from Graphics.Rendering.Cairo.Matrix
data Matrix
Matrix :: !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> Matrix
[xx] :: Matrix -> !Double
[yx] :: Matrix -> !Double
[xy] :: Matrix -> !Double
[yy] :: Matrix -> !Double
[x0] :: Matrix -> !Double
[y0] :: Matrix -> !Double
-- | Copied from Graphics.Rendering.Cairo.Matrix
identity :: Matrix
-- | Copied from Graphics.Rendering.Cairo.Matrix Rotations angle is given
-- in radians.
rotate :: Double -> Matrix -> Matrix
-- | Copied and adopted from Graphics.Rendering.Cairo.Matrix
scale :: Vector -> Matrix -> Matrix
-- | Copied and adopted from Graphics.Rendering.Cairo.Matrix
translate :: Vector -> Matrix -> Matrix
-- | Copied from Graphics.Rendering.Cairo.Matrix
scalarMultiply :: Double -> Matrix -> Matrix
-- | Copied from Graphics.Rendering.Cairo.Matrix
adjoint :: Matrix -> Matrix
-- | Copied from Graphics.Rendering.Cairo.Matrix
invert :: Matrix -> Matrix
instance GHC.Show.Show Graphics.Rendering.Chart.Geometry.Matrix
instance GHC.Show.Show Graphics.Rendering.Chart.Geometry.Rect
instance GHC.Show.Show a => GHC.Show.Show (Graphics.Rendering.Chart.Geometry.Limit a)
instance GHC.Show.Show Graphics.Rendering.Chart.Geometry.Vector
instance GHC.Show.Show Graphics.Rendering.Chart.Geometry.Point
instance GHC.Base.Monoid Graphics.Rendering.Chart.Geometry.Path
instance GHC.Num.Num Graphics.Rendering.Chart.Geometry.Matrix
module Graphics.Rendering.Chart.Backend.Types
-- | The different supported line ends.
data LineCap
-- | Just cut the line straight.
LineCapButt :: LineCap
-- | Make a rounded line end.
LineCapRound :: LineCap
-- | Make a square that ends the line.
LineCapSquare :: LineCap
-- | The different supported ways to join line ends.
data LineJoin
-- | Extends the outline until they meet each other.
LineJoinMiter :: LineJoin
-- | Draw a circle fragment to connet line end.
LineJoinRound :: LineJoin
-- | Like miter, but cuts it off if a certain threshold is exceeded.
LineJoinBevel :: LineJoin
-- | Data type for the style of a line.
data LineStyle
LineStyle :: Double -> AlphaColour Double -> [Double] -> LineCap -> LineJoin -> LineStyle
-- | The thickness of a line in device units.
[_line_width] :: LineStyle -> Double
-- | The color of a line.
[_line_color] :: LineStyle -> AlphaColour Double
-- | The dash pattern. Every value at a even index gives a dash width and
-- every value at a odd index gives a gap width in device units.
[_line_dashes] :: LineStyle -> [Double]
-- | How to end a line.
[_line_cap] :: LineStyle -> LineCap
-- | How to connect two lines.
[_line_join] :: LineStyle -> LineJoin
-- | The default line style.
-- | The possible slants of a font.
data FontSlant
-- | Normal font style without slant.
FontSlantNormal :: FontSlant
-- | With a slight slant.
FontSlantItalic :: FontSlant
-- | With a greater slant.
FontSlantOblique :: FontSlant
-- | The default font slant.
-- | The possible weights of a font.
data FontWeight
-- | Normal font style without weight.
FontWeightNormal :: FontWeight
-- | Bold font.
FontWeightBold :: FontWeight
-- | The default font weight.
-- | Data type for a font.
data FontStyle
FontStyle :: String -> Double -> FontSlant -> FontWeight -> AlphaColour Double -> FontStyle
-- | The font family or font face to use.
[_font_name] :: FontStyle -> String
-- | The height of the rendered font in device coordinates.
[_font_size] :: FontStyle -> Double
-- | The slant to render with.
[_font_slant] :: FontStyle -> FontSlant
-- | The weight to render with.
[_font_weight] :: FontStyle -> FontWeight
-- | The color to render text with.
[_font_color] :: FontStyle -> AlphaColour Double
-- | The default font style.
-- | Possible horizontal anchor points for text.
data HTextAnchor
HTA_Left :: HTextAnchor
HTA_Centre :: HTextAnchor
HTA_Right :: HTextAnchor
-- | Possible vertical anchor points for text.
data VTextAnchor
VTA_Top :: VTextAnchor
VTA_Centre :: VTextAnchor
VTA_Bottom :: VTextAnchor
VTA_BaseLine :: VTextAnchor
-- | Text metrics returned by <tt>textSize</tt>.
data TextSize
TextSize :: Double -> Double -> Double -> Double -> Double -> TextSize
-- | The total width of the text.
[textSizeWidth] :: TextSize -> Double
-- | The ascent or space above the baseline.
[textSizeAscent] :: TextSize -> Double
-- | The decent or space below the baseline.
[textSizeDescent] :: TextSize -> Double
-- | The Y bearing.
[textSizeYBearing] :: TextSize -> Double
-- | The total height of the text.
[textSizeHeight] :: TextSize -> Double
-- | Abstract data type for a fill style.
--
-- The contained action sets the required fill style in the rendering
-- state.
newtype FillStyle
FillStyleSolid :: AlphaColour Double -> FillStyle
[_fill_color] :: FillStyle -> AlphaColour Double
-- | The default fill style.
-- | A function to align points for a certain rendering device.
type AlignmentFn = Point -> Point
-- | Holds the point and coordinate alignment function.
data AlignmentFns
AlignmentFns :: AlignmentFn -> AlignmentFn -> AlignmentFns
-- | An adjustment applied immediately prior to points being displayed in
-- device coordinates.
--
-- When device coordinates correspond to pixels, a cleaner image is
-- created if this transform rounds to the nearest pixel. With
-- higher-resolution output, this transform can just be the identity
-- function.
--
-- This is usually used to align prior to stroking.
[afPointAlignFn] :: AlignmentFns -> AlignmentFn
-- | The adjustment applied immediately prior to coordinates being
-- transformed.
--
-- This is usually used to align prior to filling.
[afCoordAlignFn] :: AlignmentFns -> AlignmentFn
-- | Alignment to render on raster based graphics.
bitmapAlignmentFns :: AlignmentFns
-- | Alignment to render on vector based graphics.
vectorAlignmentFns :: AlignmentFns
line_width :: Lens' LineStyle Double
line_join :: Lens' LineStyle LineJoin
line_dashes :: Lens' LineStyle [Double]
line_color :: Lens' LineStyle (AlphaColour Double)
line_cap :: Lens' LineStyle LineCap
font_weight :: Lens' FontStyle FontWeight
font_slant :: Lens' FontStyle FontSlant
font_size :: Lens' FontStyle Double
font_name :: Lens' FontStyle String
font_color :: Lens' FontStyle (AlphaColour Double)
fill_color :: Iso' FillStyle (AlphaColour Double)
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.FillStyle
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.FillStyle
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.TextSize
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.TextSize
instance GHC.Classes.Ord Graphics.Rendering.Chart.Backend.Types.VTextAnchor
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.VTextAnchor
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.VTextAnchor
instance GHC.Classes.Ord Graphics.Rendering.Chart.Backend.Types.HTextAnchor
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.HTextAnchor
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.HTextAnchor
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.FontStyle
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.FontStyle
instance GHC.Classes.Ord Graphics.Rendering.Chart.Backend.Types.FontWeight
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.FontWeight
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.FontWeight
instance GHC.Classes.Ord Graphics.Rendering.Chart.Backend.Types.FontSlant
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.FontSlant
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.FontSlant
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.LineStyle
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.LineStyle
instance GHC.Classes.Ord Graphics.Rendering.Chart.Backend.Types.LineJoin
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.LineJoin
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.LineJoin
instance GHC.Classes.Ord Graphics.Rendering.Chart.Backend.Types.LineCap
instance GHC.Classes.Eq Graphics.Rendering.Chart.Backend.Types.LineCap
instance GHC.Show.Show Graphics.Rendering.Chart.Backend.Types.LineCap
instance Data.Default.Class.Default Graphics.Rendering.Chart.Backend.Types.LineStyle
instance Data.Default.Class.Default Graphics.Rendering.Chart.Backend.Types.FontSlant
instance Data.Default.Class.Default Graphics.Rendering.Chart.Backend.Types.FontWeight
instance Data.Default.Class.Default Graphics.Rendering.Chart.Backend.Types.FontStyle
instance Data.Default.Class.Default Graphics.Rendering.Chart.Backend.Types.FillStyle
-- | This module provides the implementation details common to all
-- <a>ChartBackend</a>s.
module Graphics.Rendering.Chart.Backend.Impl
-- | The abstract drawing operation generated when using the the chart
-- drawing API.
--
-- See the documentation of the different function for the correct
-- semantics of each instruction:
--
-- <ul>
-- <li><a>strokePath</a>, <a>fillPath</a></li>
-- <li><a>drawText</a>, <a>textSize</a></li>
-- <li><a>getPointAlignFn</a>, <a>getCoordAlignFn</a>,
-- <a>AlignmentFns</a></li>
-- <li><a>withTransform</a>, <a>withClipRegion</a></li>
-- <li><a>withLineStyle</a>, <a>withFillStyle</a>,
-- <a>withFontStyle</a></li>
-- </ul>
data ChartBackendInstr a
StrokePath :: Path -> ChartBackendInstr ()
FillPath :: Path -> ChartBackendInstr ()
GetTextSize :: String -> ChartBackendInstr TextSize
DrawText :: Point -> String -> ChartBackendInstr ()
GetAlignments :: ChartBackendInstr AlignmentFns
WithTransform :: Matrix -> Program ChartBackendInstr a -> ChartBackendInstr a
WithFontStyle :: FontStyle -> Program ChartBackendInstr a -> ChartBackendInstr a
WithFillStyle :: FillStyle -> Program ChartBackendInstr a -> ChartBackendInstr a
WithLineStyle :: LineStyle -> Program ChartBackendInstr a -> ChartBackendInstr a
WithClipRegion :: Rect -> Program ChartBackendInstr a -> ChartBackendInstr a
-- | A <a>ChartBackend</a> provides the capability to render a chart
-- somewhere.
--
-- The coordinate system of the backend has its initial origin (0,0) in
-- the top left corner of the drawing plane. The x-axis points towards
-- the top right corner and the y-axis points towards the bottom left
-- corner. The unit used by coordinates, the font size, and lengths is
-- the always the same, but depends on the backend. All angles are
-- measured in radians.
--
-- The line, fill and font style are set to their default values
-- initially.
--
-- Information about the semantics of the instructions can be found in
-- the documentation of <a>ChartBackendInstr</a>.
type ChartBackend a = Program ChartBackendInstr a
-- | Stroke the outline of the given path using the current
-- <a>LineStyle</a>. This function does <i>not</i> perform alignment
-- operations on the path. See <a>Path</a> for the exact semantic of
-- paths.
strokePath :: Path -> ChartBackend ()
-- | Fill the given path using the current <a>FillStyle</a>. The given path
-- will be closed prior to filling. This function does <i>not</i> perform
-- alignment operations on the path. See <a>Path</a> for the exact
-- semantic of paths.
fillPath :: Path -> ChartBackend ()
-- | Calculate a <a>TextSize</a> object with rendering information about
-- the given string without actually rendering it.
textSize :: String -> ChartBackend TextSize
-- | Draw a single-line textual label anchored by the baseline (vertical)
-- left (horizontal) point. Uses the current <a>FontStyle</a> for
-- drawing.
drawText :: Point -> String -> ChartBackend ()
-- | Apply the given transformation in this local environment when drawing.
-- The given transformation is applied after the current transformation.
-- This means both are combined.
withTransform :: Matrix -> ChartBackend a -> ChartBackend a
-- | Use the given font style in this local environment when drawing text.
--
-- An implementing backend is expected to guarentee to support the
-- following font families: <tt>serif</tt>, <tt>sans-serif</tt> and
-- <tt>monospace</tt>;
--
-- If the backend is not able to find or load a given font it is required
-- to fall back to a custom fail-safe font and use it instead.
withFontStyle :: FontStyle -> ChartBackend a -> ChartBackend a
-- | Use the given fill style in this local environment when filling paths.
withFillStyle :: FillStyle -> ChartBackend a -> ChartBackend a
-- | Use the given line style in this local environment when stroking
-- paths.
withLineStyle :: LineStyle -> ChartBackend a -> ChartBackend a
-- | Use the given clipping rectangle when drawing in this local
-- environment. The new clipping region is intersected with the given
-- clip region. You cannot escape the clip!
withClipRegion :: Rect -> ChartBackend a -> ChartBackend a
-- | Get the point alignment function
getPointAlignFn :: ChartBackend (Point -> Point)
-- | Get the coordinate alignment function
getCoordAlignFn :: ChartBackend (Point -> Point)
-- | This module provides the API for drawing operations abstracted to
-- arbitrary <a>ChartBackend</a>s.
module Graphics.Rendering.Chart.Backend
-- | A <a>ChartBackend</a> provides the capability to render a chart
-- somewhere.
--
-- The coordinate system of the backend has its initial origin (0,0) in
-- the top left corner of the drawing plane. The x-axis points towards
-- the top right corner and the y-axis points towards the bottom left
-- corner. The unit used by coordinates, the font size, and lengths is
-- the always the same, but depends on the backend. All angles are
-- measured in radians.
--
-- The line, fill and font style are set to their default values
-- initially.
--
-- Information about the semantics of the instructions can be found in
-- the documentation of <a>ChartBackendInstr</a>.
type ChartBackend a = Program ChartBackendInstr a
-- | Fill the given path using the current <a>FillStyle</a>. The given path
-- will be closed prior to filling. This function does <i>not</i> perform
-- alignment operations on the path. See <a>Path</a> for the exact
-- semantic of paths.
fillPath :: Path -> ChartBackend ()
-- | Stroke the outline of the given path using the current
-- <a>LineStyle</a>. This function does <i>not</i> perform alignment
-- operations on the path. See <a>Path</a> for the exact semantic of
-- paths.
strokePath :: Path -> ChartBackend ()
-- | Draw a single-line textual label anchored by the baseline (vertical)
-- left (horizontal) point. Uses the current <a>FontStyle</a> for
-- drawing.
drawText :: Point -> String -> ChartBackend ()
-- | Calculate a <a>TextSize</a> object with rendering information about
-- the given string without actually rendering it.
textSize :: String -> ChartBackend TextSize
-- | Apply the given transformation in this local environment when drawing.
-- The given transformation is applied after the current transformation.
-- This means both are combined.
withTransform :: Matrix -> ChartBackend a -> ChartBackend a
-- | Use the given clipping rectangle when drawing in this local
-- environment. The new clipping region is intersected with the given
-- clip region. You cannot escape the clip!
withClipRegion :: Rect -> ChartBackend a -> ChartBackend a
-- | Use the given font style in this local environment when drawing text.
--
-- An implementing backend is expected to guarentee to support the
-- following font families: <tt>serif</tt>, <tt>sans-serif</tt> and
-- <tt>monospace</tt>;
--
-- If the backend is not able to find or load a given font it is required
-- to fall back to a custom fail-safe font and use it instead.
withFontStyle :: FontStyle -> ChartBackend a -> ChartBackend a
-- | Use the given fill style in this local environment when filling paths.
withFillStyle :: FillStyle -> ChartBackend a -> ChartBackend a
-- | Use the given line style in this local environment when stroking
-- paths.
withLineStyle :: LineStyle -> ChartBackend a -> ChartBackend a
-- | Get the point alignment function
getPointAlignFn :: ChartBackend (Point -> Point)
-- | Get the coordinate alignment function
getCoordAlignFn :: ChartBackend (Point -> Point)
-- | Text metrics returned by <tt>textSize</tt>.
data TextSize
TextSize :: Double -> Double -> Double -> Double -> Double -> TextSize
-- | The total width of the text.
[textSizeWidth] :: TextSize -> Double
-- | The ascent or space above the baseline.
[textSizeAscent] :: TextSize -> Double
-- | The decent or space below the baseline.
[textSizeDescent] :: TextSize -> Double
-- | The Y bearing.
[textSizeYBearing] :: TextSize -> Double
-- | The total height of the text.
[textSizeHeight] :: TextSize -> Double
-- | The different supported line ends.
data LineCap
-- | Just cut the line straight.
LineCapButt :: LineCap
-- | Make a rounded line end.
LineCapRound :: LineCap
-- | Make a square that ends the line.
LineCapSquare :: LineCap
-- | The different supported ways to join line ends.
data LineJoin
-- | Extends the outline until they meet each other.
LineJoinMiter :: LineJoin
-- | Draw a circle fragment to connet line end.
LineJoinRound :: LineJoin
-- | Like miter, but cuts it off if a certain threshold is exceeded.
LineJoinBevel :: LineJoin
-- | Data type for the style of a line.
data LineStyle
LineStyle :: Double -> AlphaColour Double -> [Double] -> LineCap -> LineJoin -> LineStyle
-- | The thickness of a line in device units.
[_line_width] :: LineStyle -> Double
-- | The color of a line.
[_line_color] :: LineStyle -> AlphaColour Double
-- | The dash pattern. Every value at a even index gives a dash width and
-- every value at a odd index gives a gap width in device units.
[_line_dashes] :: LineStyle -> [Double]
-- | How to end a line.
[_line_cap] :: LineStyle -> LineCap
-- | How to connect two lines.
[_line_join] :: LineStyle -> LineJoin
line_width :: Lens' LineStyle Double
line_color :: Lens' LineStyle (AlphaColour Double)
line_dashes :: Lens' LineStyle [Double]
line_cap :: Lens' LineStyle LineCap
line_join :: Lens' LineStyle LineJoin
-- | Abstract data type for a fill style.
--
-- The contained action sets the required fill style in the rendering
-- state.
newtype FillStyle
FillStyleSolid :: AlphaColour Double -> FillStyle
[_fill_color] :: FillStyle -> AlphaColour Double
-- | The possible weights of a font.
data FontWeight
-- | Normal font style without weight.
FontWeightNormal :: FontWeight
-- | Bold font.
FontWeightBold :: FontWeight
-- | The possible slants of a font.
data FontSlant
-- | Normal font style without slant.
FontSlantNormal :: FontSlant
-- | With a slight slant.
FontSlantItalic :: FontSlant
-- | With a greater slant.
FontSlantOblique :: FontSlant
-- | Data type for a font.
data FontStyle
FontStyle :: String -> Double -> FontSlant -> FontWeight -> AlphaColour Double -> FontStyle
-- | The font family or font face to use.
[_font_name] :: FontStyle -> String
-- | The height of the rendered font in device coordinates.
[_font_size] :: FontStyle -> Double
-- | The slant to render with.
[_font_slant] :: FontStyle -> FontSlant
-- | The weight to render with.
[_font_weight] :: FontStyle -> FontWeight
-- | The color to render text with.
[_font_color] :: FontStyle -> AlphaColour Double
-- | Possible horizontal anchor points for text.
data HTextAnchor
HTA_Left :: HTextAnchor
HTA_Centre :: HTextAnchor
HTA_Right :: HTextAnchor
-- | Possible vertical anchor points for text.
data VTextAnchor
VTA_Top :: VTextAnchor
VTA_Centre :: VTextAnchor
VTA_Bottom :: VTextAnchor
VTA_BaseLine :: VTextAnchor
font_name :: Lens' FontStyle String
font_size :: Lens' FontStyle Double
font_slant :: Lens' FontStyle FontSlant
font_weight :: Lens' FontStyle FontWeight
font_color :: Lens' FontStyle (AlphaColour Double)
-- | A function to align points for a certain rendering device.
type AlignmentFn = Point -> Point
-- | Holds the point and coordinate alignment function.
data AlignmentFns
-- | Alignment to render on vector based graphics.
vectorAlignmentFns :: AlignmentFns
-- | Alignment to render on raster based graphics.
bitmapAlignmentFns :: AlignmentFns
-- | This module contains basic types and functions used for drawing.
--
-- Note that Template Haskell is used to derive accessor functions (see
-- <a>Lens</a>) for each field of the following data types:
--
-- <ul>
-- <li><a>PointStyle</a></li>
-- </ul>
--
-- These accessors are not shown in this API documentation. They have the
-- same name as the field, but with the trailing underscore dropped.
-- Hence for data field <tt>f_::F</tt> in type <tt>D</tt>, they have type
--
-- <pre>
-- f :: Control.Lens.Lens' D F
-- </pre>
module Graphics.Rendering.Chart.Drawing
-- | The different shapes a point can have.
data PointShape
-- | A circle.
PointShapeCircle :: PointShape
-- | Number of vertices and is right-side-up?
PointShapePolygon :: Int -> Bool -> PointShape
-- | A plus sign.
PointShapePlus :: PointShape
-- | A cross.
PointShapeCross :: PointShape
-- | Combination of a cross and a plus.
PointShapeStar :: PointShape
PointShapeArrowHead :: Double -> PointShape
-- | Abstract data type for the style of a plotted point.
data PointStyle
PointStyle :: AlphaColour Double -> AlphaColour Double -> Double -> Double -> PointShape -> PointStyle
-- | The color to fill the point with.
[_point_color] :: PointStyle -> AlphaColour Double
-- | The color to stroke the outline with.
[_point_border_color] :: PointStyle -> AlphaColour Double
-- | The width of the outline.
[_point_border_width] :: PointStyle -> Double
-- | The radius of the tightest surrounding circle of the point.
[_point_radius] :: PointStyle -> Double
-- | The shape.
[_point_shape] :: PointStyle -> PointShape
-- | Draw a single point at the given location.
drawPoint :: PointStyle -> Point -> ChartBackend ()
-- | Align the path by applying the given function on all points.
alignPath :: (Point -> Point) -> Path -> Path
-- | Align the path using the environment's alignment function for
-- coordinates. This is generally useful when filling. See
-- <a>alignPath</a> and <a>getCoordAlignFn</a>.
alignFillPath :: Path -> ChartBackend Path
-- | Align the path using the environment's alignment function for points.
-- This is generally useful when stroking. See <a>alignPath</a> and
-- <a>getPointAlignFn</a>.
alignStrokePath :: Path -> ChartBackend Path
-- | The points will be aligned by the <a>getCoordAlignFn</a>, so that when
-- drawing bitmaps, the edges of the region will fall between pixels.
alignFillPoints :: [Point] -> ChartBackend [Point]
-- | The points will be aligned by the <a>getPointAlignFn</a>, so that when
-- drawing bitmaps, 1 pixel wide lines will be centred on the pixels.
alignStrokePoints :: [Point] -> ChartBackend [Point]
-- | Align the point using the environment's alignment function for
-- coordinates. See <a>getCoordAlignFn</a>.
alignFillPoint :: Point -> ChartBackend Point
-- | Align the point using the environment's alignment function for points.
-- See <a>getPointAlignFn</a>.
alignStrokePoint :: Point -> ChartBackend Point
-- | Draw lines between the specified points.
strokePointPath :: [Point] -> ChartBackend ()
-- | Fill the region with the given corners.
fillPointPath :: [Point] -> ChartBackend ()
-- | Apply a local rotation. The angle is given in radians.
withRotation :: Double -> ChartBackend a -> ChartBackend a
-- | Apply a local translation.
withTranslation :: Point -> ChartBackend a -> ChartBackend a
-- | Apply a local scale.
withScale :: Vector -> ChartBackend a -> ChartBackend a
-- | Apply a local scale on the x-axis.
withScaleX :: Double -> ChartBackend a -> ChartBackend a
-- | Apply a local scale on the y-axis.
withScaleY :: Double -> ChartBackend a -> ChartBackend a
-- | Changes the <a>LineStyle</a> and <a>FillStyle</a> to comply with the
-- given <a>PointStyle</a>.
withPointStyle :: PointStyle -> ChartBackend a -> ChartBackend a
withDefaultStyle :: ChartBackend a -> ChartBackend a
-- | Draw a line of text that is aligned at a different anchor point. See
-- <a>drawText</a>.
drawTextA :: HTextAnchor -> VTextAnchor -> Point -> String -> ChartBackend ()
-- | Draw a textual label anchored by one of its corners or edges, with
-- rotation. Rotation angle is given in degrees, rotation is performed
-- around anchor point. See <a>drawText</a>.
drawTextR :: HTextAnchor -> VTextAnchor -> Double -> Point -> String -> ChartBackend ()
-- | Draw a multi-line textual label anchored by one of its corners or
-- edges, with rotation. Rotation angle is given in degrees, rotation is
-- performed around anchor point. See <a>drawText</a>.
drawTextsR :: HTextAnchor -> VTextAnchor -> Double -> Point -> String -> ChartBackend ()
-- | Return the bounding rectangle for a text string positioned where it
-- would be drawn by <a>drawText</a>. See <a>textSize</a>.
textDrawRect :: HTextAnchor -> VTextAnchor -> Point -> String -> ChartBackend Rect
-- | Get the width and height of the string when rendered. See
-- <a>textSize</a>.
textDimension :: String -> ChartBackend RectSize
-- | The default sequence of colours to use when plotings different data
-- sets in a graph.
defaultColorSeq :: [AlphaColour Double]
-- | Create a solid line style (not dashed).
solidLine :: Double -> AlphaColour Double -> LineStyle
-- | Create a dashed line style.
dashedLine :: Double -> [Double] -> AlphaColour Double -> LineStyle
-- | Style for filled circle points.
filledCircles :: Double -> AlphaColour Double -> PointStyle
-- | Style for stroked circle points.
hollowCircles :: Double -> Double -> AlphaColour Double -> PointStyle
-- | Style for filled polygon points.
filledPolygon :: Double -> Int -> Bool -> AlphaColour Double -> PointStyle
-- | Style for stroked polygon points.
hollowPolygon :: Double -> Double -> Int -> Bool -> AlphaColour Double -> PointStyle
-- | Plus sign point style.
plusses :: Double -> Double -> AlphaColour Double -> PointStyle
-- | Cross point style.
exes :: Double -> Double -> AlphaColour Double -> PointStyle
-- | Combination of plus and cross point style.
stars :: Double -> Double -> AlphaColour Double -> PointStyle
arrows :: Double -> Double -> Double -> AlphaColour Double -> PointStyle
-- | Fill style that fill everything this the given colour.
solidFillStyle :: AlphaColour Double -> FillStyle
point_color :: Lens' PointStyle (AlphaColour Double)
point_border_color :: Lens' PointStyle (AlphaColour Double)
point_border_width :: Lens' PointStyle Double
point_radius :: Lens' PointStyle Double
point_shape :: Lens' PointStyle PointShape
instance Data.Default.Class.Default Graphics.Rendering.Chart.Drawing.PointStyle
-- | This module contains the definition of the <a>Renderable</a> type,
-- which is a composable drawing element, along with assorted functions
-- to them.
module Graphics.Rendering.Chart.Renderable
-- | A Renderable is a record of functions required to layout a graphic
-- element.
data Renderable a
Renderable :: ChartBackend RectSize -> (RectSize -> ChartBackend (PickFn a)) -> Renderable a
-- | Calculate the minimum size of the renderable.
[minsize] :: Renderable a -> ChartBackend RectSize
-- | Draw the renderable with a rectangle, which covers the origin to a
-- given point.
--
-- The resulting "pick" function maps a point in the image to a value.
[render] :: Renderable a -> RectSize -> ChartBackend (PickFn a)
-- | A type class abtracting the conversion of a value to a Renderable.
class ToRenderable a
toRenderable :: ToRenderable a => a -> Renderable ()
-- | A function that maps a point in device coordinates to some value.
--
-- Perhaps it might be generalised from Maybe a to (MonadPlus m ) => m
-- a in the future.
type PickFn a = Point -> Maybe a
data Rectangle
Rectangle :: RectSize -> Maybe FillStyle -> Maybe LineStyle -> RectCornerStyle -> Rectangle
[_rect_minsize] :: Rectangle -> RectSize
[_rect_fillStyle] :: Rectangle -> Maybe FillStyle
[_rect_lineStyle] :: Rectangle -> Maybe LineStyle
[_rect_cornerStyle] :: Rectangle -> RectCornerStyle
data RectCornerStyle
RCornerSquare :: RectCornerStyle
RCornerBevel :: Double -> RectCornerStyle
RCornerRounded :: Double -> RectCornerStyle
rectangleToRenderable :: Rectangle -> Renderable a
-- | Overlay a renderable over a solid background fill.
fillBackground :: FillStyle -> Renderable a -> Renderable a
-- | Add some spacing at the edges of a renderable.
addMargins :: (Double, Double, Double, Double) -> Renderable a -> Renderable a
emptyRenderable :: Renderable a
-- | Helper function for using a renderable, when we generate it in the
-- ChartBackend monad.
embedRenderable :: ChartBackend (Renderable a) -> Renderable a
-- | Construct a renderable from a text string, aligned with the axes.
label :: FontStyle -> HTextAnchor -> VTextAnchor -> String -> Renderable String
-- | Construct a renderable from a text string, rotated wrt to axes. The
-- angle of rotation is in degrees, measured clockwise from the
-- horizontal.
rlabel :: FontStyle -> HTextAnchor -> VTextAnchor -> Double -> String -> Renderable String
-- | Create a blank renderable with a specified minimum size.
spacer :: RectSize -> Renderable a
-- | Create a blank renderable with a minimum size the same as some other
-- renderable.
spacer1 :: Renderable a -> Renderable b
-- | Replace the pick function of a renderable with another.
setPickFn :: PickFn b -> Renderable a -> Renderable b
-- | Map a function over the result of a renderable's pickfunction, keeping
-- only <a>Just</a> results.
mapMaybePickFn :: (a -> Maybe b) -> Renderable a -> Renderable b
-- | Map a function over result of a renderable's pickfunction.
mapPickFn :: (a -> b) -> Renderable a -> Renderable b
nullPickFn :: PickFn a
rect_minsize :: Lens' Rectangle RectSize
rect_fillStyle :: Lens' Rectangle (Maybe FillStyle)
rect_lineStyle :: Lens' Rectangle (Maybe LineStyle)
rect_cornerStyle :: Lens' Rectangle RectCornerStyle
instance Data.Default.Class.Default Graphics.Rendering.Chart.Renderable.Rectangle
instance Graphics.Rendering.Chart.Renderable.ToRenderable Graphics.Rendering.Chart.Renderable.Rectangle
-- | Type definitions for Axes
module Graphics.Rendering.Chart.Axis.Types
-- | The basic data associated with an axis showing values of type x.
data AxisData x
AxisData :: AxisVisibility -> (Range -> x -> Double) -> (Range -> Double -> x) -> [(x, Double)] -> [[(x, String)]] -> [x] -> AxisData x
-- | Which parts of the axis shall be displayed.
[_axis_visibility] :: AxisData x -> AxisVisibility
-- | The _axis_viewport function maps values into device coordinates.
[_axis_viewport] :: AxisData x -> Range -> x -> Double
-- | The _axis_tropweiv function maps device coordinates back to values.
[_axis_tropweiv] :: AxisData x -> Range -> Double -> x
-- | The tick marks on the axis as pairs. The first element is the position
-- on the axis (in viewport units) and the second element is the length
-- of the tick in output coordinates. The tick starts on the axis, and
-- positive numbers are drawn towards the plot area.
[_axis_ticks] :: AxisData x -> [(x, Double)]
-- | The labels on an axis as pairs. The first element of the pair is the
-- position on the axis (in viewport units) and the second is the label
-- text string. Note that multiple sets of labels can be specified, and
-- are shown successively further away from the axis line.
[_axis_labels] :: AxisData x -> [[(x, String)]]
-- | The positions on the axis (in viewport units) where we want to show
-- grid lines.
[_axis_grid] :: AxisData x -> [x]
-- | Configures whick visual elements of a axis are shown at the
-- appropriate edge of a plot area.
data AxisVisibility
AxisVisibility :: Bool -> Bool -> Bool -> AxisVisibility
-- | Whether to display a line along the axis.
[_axis_show_line] :: AxisVisibility -> Bool
-- | Whether to display the tick marks.
[_axis_show_ticks] :: AxisVisibility -> Bool
-- | Whether to display the labels.
[_axis_show_labels] :: AxisVisibility -> Bool
-- | Collect the information we need to render an axis. The bool is true if
-- the axis direction is reversed.
data AxisT x
AxisT :: RectEdge -> AxisStyle -> Bool -> (AxisData x) -> AxisT x
-- | Control values for how an axis gets displayed.
data AxisStyle
AxisStyle :: LineStyle -> FontStyle -> LineStyle -> Double -> AxisStyle
-- | <a>LineStyle</a> to use for axis line and ticks.
[_axis_line_style] :: AxisStyle -> LineStyle
-- | <a>FontStyle</a> to use for axis labels.
[_axis_label_style] :: AxisStyle -> FontStyle
-- | <a>LineStyle</a> to use for axis grid.
[_axis_grid_style] :: AxisStyle -> LineStyle
-- | How far the labels are to be drawn from the axis.
[_axis_label_gap] :: AxisStyle -> Double
-- | A typeclass abstracting the functions we need to be able to plot
-- against an axis of type a
class Ord a => PlotValue a
toValue :: PlotValue a => a -> Double
fromValue :: PlotValue a => Double -> a
autoAxis :: PlotValue a => AxisFn a
-- | A function to generate the axis data, given the data values to be
-- plotted against it.
type AxisFn x = [x] -> AxisData x
-- | The default <a>LineStyle</a> of an axis.
defaultAxisLineStyle :: LineStyle
-- | The default <a>LineStyle</a> of a plot area grid.
defaultGridLineStyle :: LineStyle
-- | Construct an axis given the positions for ticks, grid lines, and
-- labels, and the labelling function
makeAxis :: PlotValue x => (x -> String) -> ([x], [x], [x]) -> AxisData x
-- | Construct an axis given the positions for ticks, grid lines, and
-- labels, and the positioning and labelling functions
makeAxis' :: Ord x => (x -> Double) -> (Double -> x) -> (x -> String) -> ([x], [x], [x]) -> AxisData x
-- | Construct a renderable from an axis, in order that it can be composed
-- with other renderables and drawn. This does not include the drawing of
-- the grid, which must be done separately by the <a>renderAxisGrid</a>
-- function.
axisToRenderable :: AxisT x -> Renderable x
renderAxisGrid :: RectSize -> AxisT z -> ChartBackend ()
-- | Calculate the amount by which the labels extend beyond the ends of the
-- axis.
axisOverhang :: (Ord x) => AxisT x -> ChartBackend (Double, Double)
-- | A linear mapping of points in one range to another.
vmap :: PlotValue x => (x, x) -> Range -> x -> Double
-- | The inverse mapping from device co-ordinate range back to interesting
-- values.
invmap :: PlotValue x => (x, x) -> Range -> Double -> x
-- | A linear mapping of points in one range to another.
linMap :: (a -> Double) -> (a, a) -> Range -> a -> Double
-- | An inverse linear mapping of points from one range to another.
invLinMap :: (Double -> a) -> (a -> Double) -> (a, a) -> Range -> Double -> a
-- | Modifier to position grid lines to line up with the ticks
axisGridAtTicks :: AxisData x -> AxisData x
-- | Modifier to position grid lines to line up with only the major ticks
axisGridAtBigTicks :: AxisData x -> AxisData x
-- | Modifier to position grid lines to line up with the labels
axisGridAtLabels :: AxisData x -> AxisData x
-- | Modifier to remove grid lines from an axis
axisGridHide :: AxisData x -> AxisData x
-- | Modifier to change labels on an axis
axisLabelsOverride :: [(x, String)] -> AxisData x -> AxisData x
axis_show_line :: Lens' AxisVisibility Bool
axis_show_ticks :: Lens' AxisVisibility Bool
axis_show_labels :: Lens' AxisVisibility Bool
axis_visibility :: Lens' (AxisData x_aIL8) AxisVisibility
axis_viewport :: Lens' (AxisData x_aIL8) (Range -> x_aIL8 -> Double)
axis_tropweiv :: Lens' (AxisData x_aIL8) (Range -> Double -> x_aIL8)
axis_ticks :: Lens' (AxisData x_aIL8) [(x_aIL8, Double)]
axis_labels :: Lens' (AxisData x_aIL8) [[(x_aIL8, String)]]
axis_grid :: Lens' (AxisData x_aIL8) [x_aIL8]
axis_line_style :: Lens' AxisStyle LineStyle
axis_label_style :: Lens' AxisStyle FontStyle
axis_grid_style :: Lens' AxisStyle LineStyle
axis_label_gap :: Lens' AxisStyle Double
instance Data.Default.Class.Default Graphics.Rendering.Chart.Axis.Types.AxisStyle
instance Data.Default.Class.Default Graphics.Rendering.Chart.Axis.Types.AxisVisibility
-- | Calculate and render floating value axes including doubles with
-- linear, log, and percentage scaling.
module Graphics.Rendering.Chart.Axis.Floating
-- | A wrapper class for doubles used to indicate they are to be plotted
-- against a percentage axis.
newtype Percent
Percent :: Double -> Percent
[unPercent] :: Percent -> Double
data LinearAxisParams a
LinearAxisParams :: (a -> String) -> Int -> Int -> LinearAxisParams a
-- | The function used to show the axes labels.
[_la_labelf] :: LinearAxisParams a -> a -> String
-- | The target number of labels to be shown.
[_la_nLabels] :: LinearAxisParams a -> Int
-- | The target number of ticks to be shown.
[_la_nTicks] :: LinearAxisParams a -> Int
-- | A wrapper class for doubles used to indicate they are to be plotted
-- against a log axis.
newtype LogValue
LogValue :: Double -> LogValue
data LogAxisParams a
LogAxisParams :: (a -> String) -> LogAxisParams a
-- | The function used to show the axes labels.
[_loga_labelf] :: LogAxisParams a -> a -> String
-- | Generate a linear axis with the specified bounds
scaledAxis :: RealFloat a => LinearAxisParams a -> (a, a) -> AxisFn a
-- | Generate a linear axis automatically, scaled appropriately for the
-- input data.
autoScaledAxis :: RealFloat a => LinearAxisParams a -> AxisFn a
-- | Generate a log axis automatically, scaled appropriate for the input
-- data.
autoScaledLogAxis :: RealFloat a => LogAxisParams a -> AxisFn a
-- | Given a target number of values, and a list of input points, find
-- evenly spaced values from the set {1*X, 2*X, 2.5*X, 5*X} (where X is
-- some power of ten) that evenly cover the input points.
autoSteps :: Int -> [Double] -> [Double]
la_labelf :: Lens (LinearAxisParams a_aSjX) (LinearAxisParams a_aTpl) (a_aSjX -> String) (a_aTpl -> String)
la_nLabels :: Lens' (LinearAxisParams a_aSjX) Int
la_nTicks :: Lens' (LinearAxisParams a_aSjX) Int
loga_labelf :: Iso (LogAxisParams a_aSjW) (LogAxisParams a_aTr2) (a_aSjW -> String) (a_aTr2 -> String)
instance GHC.Float.RealFloat Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Float.Floating Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Real.RealFrac Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Real.Fractional Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Real.Real Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Num.Num Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Classes.Ord Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Classes.Eq Graphics.Rendering.Chart.Axis.Floating.LogValue
instance GHC.Float.RealFloat Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Float.Floating Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Real.RealFrac Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Real.Fractional Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Real.Real Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Num.Num Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Classes.Ord Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Classes.Eq Graphics.Rendering.Chart.Axis.Floating.Percent
instance Graphics.Rendering.Chart.Axis.Types.PlotValue GHC.Types.Double
instance Graphics.Rendering.Chart.Axis.Types.PlotValue GHC.Types.Float
instance GHC.Show.Show Graphics.Rendering.Chart.Axis.Floating.Percent
instance Graphics.Rendering.Chart.Axis.Types.PlotValue Graphics.Rendering.Chart.Axis.Floating.Percent
instance GHC.Show.Show Graphics.Rendering.Chart.Axis.Floating.LogValue
instance Graphics.Rendering.Chart.Axis.Types.PlotValue Graphics.Rendering.Chart.Axis.Floating.LogValue
instance (GHC.Show.Show a, GHC.Float.RealFloat a) => Data.Default.Class.Default (Graphics.Rendering.Chart.Axis.Floating.LinearAxisParams a)
instance (GHC.Show.Show a, GHC.Float.RealFloat a) => Data.Default.Class.Default (Graphics.Rendering.Chart.Axis.Floating.LogAxisParams a)
-- | Calculate and render integer indexed axes
module Graphics.Rendering.Chart.Axis.Int
defaultIntAxis :: (Show a) => LinearAxisParams a
scaledIntAxis :: (Integral i, PlotValue i) => LinearAxisParams i -> (i, i) -> AxisFn i
autoScaledIntAxis :: (Integral i, PlotValue i) => LinearAxisParams i -> AxisFn i
instance Graphics.Rendering.Chart.Axis.Types.PlotValue GHC.Types.Int
instance Graphics.Rendering.Chart.Axis.Types.PlotValue GHC.Integer.Type.Integer
-- | Calculate and render time axes
module Graphics.Rendering.Chart.Axis.LocalTime
-- | TimeSeq is a (potentially infinite) set of times. When passed a
-- reference time, the function returns a a pair of lists. The first
-- contains all times in the set less than the reference time in
-- decreasing order. The second contains all times in the set greater
-- than or equal to the reference time, in increasing order.
type TimeSeq = LocalTime -> ([LocalTime], [LocalTime])
-- | How to display a time
type TimeLabelFn = LocalTime -> String
data TimeLabelAlignment
UnderTicks :: TimeLabelAlignment
BetweenTicks :: TimeLabelAlignment
-- | Create an <a>AxisFn</a> to for a time axis.
--
-- The values to be plotted against this axis can be created with
-- <a>doubleFromLocalTime</a>.
timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> TimeLabelAlignment -> TimeSeq -> TimeLabelFn -> TimeLabelAlignment -> AxisFn LocalTime
-- | Automatically choose a suitable time axis, based upon the time range
-- of data. The values to be plotted against this axis can be created
-- with <a>doubleFromLocalTime</a>.
autoTimeAxis :: AxisFn LocalTime
-- | A <a>TimeSeq</a> for calendar days.
days :: TimeSeq
-- | A <a>TimeSeq</a> for calendar months.
months :: TimeSeq
-- | A <a>TimeSeq</a> for calendar years.
years :: TimeSeq
-- | Map a LocalTime value to a plot coordinate.
doubleFromLocalTime :: LocalTime -> Double
instance GHC.Show.Show Graphics.Rendering.Chart.Axis.LocalTime.TimeLabelAlignment
instance Graphics.Rendering.Chart.Axis.Types.PlotValue Data.Time.LocalTime.LocalTime.LocalTime
-- | Calculate and render unit indexed axes
module Graphics.Rendering.Chart.Axis.Unit
unitAxis :: AxisData ()
instance Graphics.Rendering.Chart.Axis.Types.PlotValue ()
-- | Calculate and render indexed axes
module Graphics.Rendering.Chart.Axis.Indexed
-- | Type for capturing values plotted by index number (ie position in a
-- list) rather than a numerical value.
newtype PlotIndex
PlotIndex :: Int -> PlotIndex
[plotindex_i] :: PlotIndex -> Int
-- | Create an axis for values indexed by position. The list of strings are
-- the labels to be used.
autoIndexAxis :: Integral i => [String] -> [i] -> AxisData i
-- | Augment a list of values with index numbers for plotting.
addIndexes :: [a] -> [(PlotIndex, a)]
instance GHC.Show.Show Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance GHC.Real.Integral Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance GHC.Real.Real Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance GHC.Num.Num Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance GHC.Enum.Enum Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance GHC.Classes.Ord Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance GHC.Classes.Eq Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
instance Graphics.Rendering.Chart.Axis.Types.PlotValue Graphics.Rendering.Chart.Axis.Indexed.PlotIndex
-- | Code to calculate and render axes.
module Graphics.Rendering.Chart.Axis
-- | A container type for values that can be composed by horizonal and
-- vertical layout.
module Graphics.Rendering.Chart.Grid
-- | Abstract datatype representing a grid.
data Grid a
type Span = (Int, Int)
-- | When more space is available for an item than the total width of
-- items, extra added space is proportional to 'space weight'.
type SpaceWeight = (Double, Double)
-- | A 1x1 grid from a given value, with no extra space.
tval :: a -> Grid a
-- | A WxH (measured in cells) grid from a given value, with space weight
-- (1,1).
tspan :: a -> Span -> Grid a
-- | A 1x1 empty grid.
empty :: Grid a
-- | A 0x0 empty grid.
nullt :: Grid a
-- | A synonym for <a>beside</a>.
(.|.) :: Grid a -> Grid a -> Grid a
-- | A synonym for <a>above</a>.
(./.) :: Grid a -> Grid a -> Grid a
above :: Grid a -> Grid a -> Grid a
aboveN :: [Grid a] -> Grid a
beside :: Grid a -> Grid a -> Grid a
besideN :: [Grid a] -> Grid a
-- | One grid over the other. The first argument is shallow, the second is
-- deep.
overlay :: Grid a -> Grid a -> Grid a
width :: Grid a -> Int
height :: Grid a -> Int
gridToRenderable :: Grid (Renderable a) -> Renderable a
-- | Sets the space weight of *every* cell of the grid to given value.
weights :: SpaceWeight -> Grid a -> Grid a
-- | A value placed below the grid, occupying 1 row with the same
-- horizontal span as the grid.
aboveWide :: Grid a -> a -> Grid a
-- | A value occupying 1 row with the same horizontal span as the grid.
wideAbove :: a -> Grid a -> Grid a
-- | A value placed to the left of the grid, occupying 1 column with the
-- same vertical span as the grid.
tallBeside :: a -> Grid a -> Grid a
-- | A value placed to the right of the grid, occupying 1 column with the
-- same vertical span as the grid.
besideTall :: Grid a -> a -> Grid a
-- | A value placed under a grid, with the same span as the grid.
fullOverlayUnder :: a -> Grid a -> Grid a
-- | A value placed over a grid, with the same span as the grid.
fullOverlayOver :: a -> Grid a -> Grid a
instance GHC.Show.Show a => GHC.Show.Show (Graphics.Rendering.Chart.Grid.Grid a)
instance GHC.Base.Functor Graphics.Rendering.Chart.Grid.Grid
instance Graphics.Rendering.Chart.Renderable.ToRenderable a => Graphics.Rendering.Chart.Renderable.ToRenderable (Graphics.Rendering.Chart.Grid.Grid a)
-- | Types and functions for handling the legend(s) on a chart. A legend is
-- an area on the chart used to label the plotted values.
module Graphics.Rendering.Chart.Legend
data Legend x y
Legend :: LegendStyle -> [(String, Rect -> ChartBackend ())] -> Legend x y
data LegendStyle
LegendStyle :: FontStyle -> Double -> Double -> LegendOrientation -> LegendStyle
[_legend_label_style] :: LegendStyle -> FontStyle
[_legend_margin] :: LegendStyle -> Double
[_legend_plot_size] :: LegendStyle -> Double
[_legend_orientation] :: LegendStyle -> LegendOrientation
-- | Legends can be constructed in two orientations: in rows (where we
-- specify the maximum number of columns), and in columns (where we
-- specify the maximum number of rows)
data LegendOrientation
LORows :: Int -> LegendOrientation
LOCols :: Int -> LegendOrientation
legendToRenderable :: Legend x y -> Renderable String
legend_label_style :: Lens' LegendStyle FontStyle
legend_margin :: Lens' LegendStyle Double
legend_plot_size :: Lens' LegendStyle Double
legend_orientation :: Lens' LegendStyle LegendOrientation
instance Graphics.Rendering.Chart.Renderable.ToRenderable (Graphics.Rendering.Chart.Legend.Legend x y)
instance Data.Default.Class.Default Graphics.Rendering.Chart.Legend.LegendStyle
-- | Datatypes and functions common to the implementation of the various
-- plot types.
module Graphics.Rendering.Chart.Plot.Types
-- | Interface to control plotting on a 2D area.
data Plot x y
Plot :: (PointMapFn x y -> ChartBackend ()) -> [(String, Rect -> ChartBackend ())] -> ([x], [y]) -> Plot x y
-- | Given the mapping between model space coordinates and device
-- coordinates, render this plot into a chart.
[_plot_render] :: Plot x y -> PointMapFn x y -> ChartBackend ()
-- | Details for how to show this plot in a legend. For each item the
-- string is the text to show, and the function renders a graphical
-- sample of the plot.
[_plot_legend] :: Plot x y -> [(String, Rect -> ChartBackend ())]
-- | All of the model space coordinates to be plotted. These are used to
-- autoscale the axes where necessary.
[_plot_all_points] :: Plot x y -> ([x], [y])
-- | Join any two plots together (they will share a legend).
joinPlot :: Plot x y -> Plot x y -> Plot x y
-- | A type class abstracting the conversion of a value to a Plot.
class ToPlot a
toPlot :: ToPlot a => a x y -> Plot x y
mapXY :: PointMapFn x y -> (x, y) -> Point
plot_render :: Lens' (Plot x_a1GYE y_a1GYF) (PointMapFn x_a1GYE y_a1GYF -> ChartBackend ())
plot_legend :: Lens' (Plot x_a1GYE y_a1GYF) [(String, Rect -> ChartBackend ())]
plot_all_points :: Lens' (Plot x_a1GYE y_a1GYF) ([x_a1GYE], [y_a1GYF])
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.Types.Plot
-- | Plots that don't show, but occupy space so as to effect axis scaling
module Graphics.Rendering.Chart.Plot.Hidden
-- | Value defining some hidden x and y values. The values are not
-- displayed, but they still affect axis scaling.
data PlotHidden x y
PlotHidden :: [x] -> [y] -> PlotHidden x y
[_plot_hidden_x_values] :: PlotHidden x y -> [x]
[_plot_hidden_y_values] :: PlotHidden x y -> [y]
plot_hidden_x_values :: Lens (PlotHidden x_a1HoO y_a1HoP) (PlotHidden x_a1HpC y_a1HoP) [x_a1HoO] [x_a1HpC]
plot_hidden_y_values :: Lens (PlotHidden x_a1HoO y_a1HoP) (PlotHidden x_a1HoO y_a1HpD) [y_a1HoP] [y_a1HpD]
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.Hidden.PlotHidden
-- | Line plots
module Graphics.Rendering.Chart.Plot.Lines
-- | Value defining a series of (possibly disjointed) lines, and a style in
-- which to render them.
data PlotLines x y
PlotLines :: String -> LineStyle -> [[(x, y)]] -> [[(Limit x, Limit y)]] -> PlotLines x y
[_plot_lines_title] :: PlotLines x y -> String
[_plot_lines_style] :: PlotLines x y -> LineStyle
-- | The lines to be plotted
[_plot_lines_values] :: PlotLines x y -> [[(x, y)]]
-- | Additional lines to be plotted, specified using the Limit type to
-- allow referencing the edges of the plot area.
[_plot_lines_limit_values] :: PlotLines x y -> [[(Limit x, Limit y)]]
defaultPlotLineStyle :: LineStyle
-- | Helper function to plot a single horizontal line.
hlinePlot :: String -> LineStyle -> b -> Plot a b
-- | Helper function to plot a single vertical line.
vlinePlot :: String -> LineStyle -> a -> Plot a b
plot_lines_title :: Lens' (PlotLines x_a1HCf y_a1HCg) String
plot_lines_style :: Lens' (PlotLines x_a1HCf y_a1HCg) LineStyle
plot_lines_values :: Lens' (PlotLines x_a1HCf y_a1HCg) [[(x_a1HCf, y_a1HCg)]]
plot_lines_limit_values :: Lens' (PlotLines x_a1HCf y_a1HCg) [[(Limit x_a1HCf, Limit y_a1HCg)]]
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.Lines.PlotLines
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Lines.PlotLines x y)
-- | Vector plots
module Graphics.Rendering.Chart.Plot.Vectors
data PlotVectors x y
PlotVectors :: String -> VectorStyle -> Double -> [(x, y)] -> ((x, y) -> (x, y)) -> [((x, y), (x, y))] -> PlotVectors x y
[_plot_vectors_title] :: PlotVectors x y -> String
[_plot_vectors_style] :: PlotVectors x y -> VectorStyle
-- | Set to 1 (default) to normalize the length of vectors to a space
-- between them (so that the vectors never overlap on the graph). Set to
-- 0 to disable any scaling. Values in between 0 and 1 are also permitted
-- to adjust scaling.
[_plot_vectors_scale] :: PlotVectors x y -> Double
-- | Provide a square-tiled regular grid.
[_plot_vectors_grid] :: PlotVectors x y -> [(x, y)]
-- | Provide a vector field (R^2 -> R^2) function.
[_plot_vectors_mapf] :: PlotVectors x y -> (x, y) -> (x, y)
-- | Provide a prepared list of (start,vector) pairs.
[_plot_vectors_values] :: PlotVectors x y -> [((x, y), (x, y))]
data VectorStyle
VectorStyle :: LineStyle -> PointStyle -> VectorStyle
[_vector_line_style] :: VectorStyle -> LineStyle
[_vector_head_style] :: VectorStyle -> PointStyle
plotVectorField :: (PlotValue x, PlotValue y) => PlotVectors x y -> Plot x y
plot_vectors_mapf :: Lens' (PlotVectors x_a1IWv y_a1IWw) ((x_a1IWv, y_a1IWw) -> (x_a1IWv, y_a1IWw))
plot_vectors_grid :: Lens' (PlotVectors x_a1IWv y_a1IWw) [(x_a1IWv, y_a1IWw)]
plot_vectors_title :: Lens' (PlotVectors x_a1IWv y_a1IWw) String
plot_vectors_style :: Lens' (PlotVectors x_a1IWv y_a1IWw) VectorStyle
plot_vectors_scale :: Lens' (PlotVectors x_a1IWv y_a1IWw) Double
plot_vectors_values :: Lens' (PlotVectors x_a1IWv y_a1IWw) [((x_a1IWv, y_a1IWw), (x_a1IWv, y_a1IWw))]
vector_line_style :: Lens' VectorStyle LineStyle
vector_head_style :: Lens' VectorStyle PointStyle
instance Data.Default.Class.Default Graphics.Rendering.Chart.Plot.Vectors.VectorStyle
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Vectors.PlotVectors x y)
-- | Functions to plot sets of points, marked in various styles.
module Graphics.Rendering.Chart.Plot.Points
-- | Value defining a series of datapoints, and a style in which to render
-- them.
data PlotPoints x y
PlotPoints :: String -> PointStyle -> [(x, y)] -> PlotPoints x y
[_plot_points_title] :: PlotPoints x y -> String
[_plot_points_style] :: PlotPoints x y -> PointStyle
[_plot_points_values] :: PlotPoints x y -> [(x, y)]
plot_points_title :: Lens' (PlotPoints x_a1PWJ y_a1PWK) String
plot_points_style :: Lens' (PlotPoints x_a1PWJ y_a1PWK) PointStyle
plot_points_values :: Lens (PlotPoints x_a1PWJ y_a1PWK) (PlotPoints x_a1Q07 y_a1Q08) [(x_a1PWJ, y_a1PWK)] [(x_a1Q07, y_a1Q08)]
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.Points.PlotPoints
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Points.PlotPoints x y)
-- | Plots that fill the area between two lines.
module Graphics.Rendering.Chart.Plot.FillBetween
-- | Value specifying a plot filling the area between two sets of Y
-- coordinates, given common X coordinates.
data PlotFillBetween x y
PlotFillBetween :: String -> FillStyle -> [(x, (y, y))] -> PlotFillBetween x y
[_plot_fillbetween_title] :: PlotFillBetween x y -> String
[_plot_fillbetween_style] :: PlotFillBetween x y -> FillStyle
[_plot_fillbetween_values] :: PlotFillBetween x y -> [(x, (y, y))]
plot_fillbetween_title :: Lens' (PlotFillBetween x_a1QHR y_a1QHS) String
plot_fillbetween_style :: Lens' (PlotFillBetween x_a1QHR y_a1QHS) FillStyle
plot_fillbetween_values :: Lens (PlotFillBetween x_a1QHR y_a1QHS) (PlotFillBetween x_a1QMn y_a1QMo) [(x_a1QHR, (y_a1QHS, y_a1QHS))] [(x_a1QMn, (y_a1QMo, y_a1QMo))]
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.FillBetween.PlotFillBetween
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.FillBetween.PlotFillBetween x y)
-- | Plot series of points with associated error bars.
module Graphics.Rendering.Chart.Plot.ErrBars
-- | Value defining a series of error intervals, and a style in which to
-- render them.
data PlotErrBars x y
PlotErrBars :: String -> LineStyle -> Double -> Double -> [ErrPoint x y] -> PlotErrBars x y
[_plot_errbars_title] :: PlotErrBars x y -> String
[_plot_errbars_line_style] :: PlotErrBars x y -> LineStyle
[_plot_errbars_tick_length] :: PlotErrBars x y -> Double
[_plot_errbars_overhang] :: PlotErrBars x y -> Double
[_plot_errbars_values] :: PlotErrBars x y -> [ErrPoint x y]
data ErrPoint x y
ErrPoint :: ErrValue x -> ErrValue y -> ErrPoint x y
[ep_x] :: ErrPoint x y -> ErrValue x
[ep_y] :: ErrPoint x y -> ErrValue y
-- | Value for holding a point with associated error bounds for each axis.
data ErrValue x
ErrValue :: x -> x -> x -> ErrValue x
[ev_low] :: ErrValue x -> x
[ev_best] :: ErrValue x -> x
[ev_high] :: ErrValue x -> x
-- | When the error is symmetric, we can simply pass in dx for the error.
symErrPoint :: (Num a, Num b) => a -> b -> a -> b -> ErrPoint a b
plot_errbars_title :: Lens' (PlotErrBars x_a1RG3 y_a1RG4) String
plot_errbars_line_style :: Lens' (PlotErrBars x_a1RG3 y_a1RG4) LineStyle
plot_errbars_tick_length :: Lens' (PlotErrBars x_a1RG3 y_a1RG4) Double
plot_errbars_overhang :: Lens' (PlotErrBars x_a1RG3 y_a1RG4) Double
plot_errbars_values :: Lens (PlotErrBars x_a1RG3 y_a1RG4) (PlotErrBars x_a1RVe y_a1RVf) [ErrPoint x_a1RG3 y_a1RG4] [ErrPoint x_a1RVe y_a1RVf]
instance (GHC.Show.Show x, GHC.Show.Show y) => GHC.Show.Show (Graphics.Rendering.Chart.Plot.ErrBars.ErrPoint x y)
instance GHC.Show.Show x => GHC.Show.Show (Graphics.Rendering.Chart.Plot.ErrBars.ErrValue x)
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.ErrBars.PlotErrBars
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.ErrBars.PlotErrBars x y)
-- | Candlestick charts for financial plotting
module Graphics.Rendering.Chart.Plot.Candle
-- | Value defining a financial interval: opening and closing prices, with
-- maxima and minima; and a style in which to render them. By convention,
-- there are different fill styles depending on whether the price rises
-- (open < close) or falls (close < open). (This plot type can also
-- be re-purposed for statistical intervals, e.g. minimum, first
-- quartile, median, third quartile, maximum.)
data PlotCandle x y
PlotCandle :: String -> LineStyle -> Bool -> FillStyle -> FillStyle -> Double -> Double -> Double -> [Candle x y] -> PlotCandle x y
[_plot_candle_title] :: PlotCandle x y -> String
[_plot_candle_line_style] :: PlotCandle x y -> LineStyle
[_plot_candle_fill] :: PlotCandle x y -> Bool
[_plot_candle_rise_fill_style] :: PlotCandle x y -> FillStyle
[_plot_candle_fall_fill_style] :: PlotCandle x y -> FillStyle
[_plot_candle_tick_length] :: PlotCandle x y -> Double
[_plot_candle_width] :: PlotCandle x y -> Double
[_plot_candle_centre] :: PlotCandle x y -> Double
[_plot_candle_values] :: PlotCandle x y -> [Candle x y]
-- | A Value holding price intervals for a given x-coord. An alternative
-- view is that these are statistical intervals: the 0th, 25th, 50th,
-- 75th, and 100th percentiles.
data Candle x y
Candle :: x -> y -> y -> y -> y -> y -> Candle x y
[candle_x] :: Candle x y -> x
[candle_low] :: Candle x y -> y
[candle_open] :: Candle x y -> y
[candle_mid] :: Candle x y -> y
[candle_close] :: Candle x y -> y
[candle_high] :: Candle x y -> y
plot_candle_title :: Lens' (PlotCandle x_a1UDd y_a1UDe) String
plot_candle_line_style :: Lens' (PlotCandle x_a1UDd y_a1UDe) LineStyle
plot_candle_tick_length :: Lens' (PlotCandle x_a1UDd y_a1UDe) Double
plot_candle_width :: Lens' (PlotCandle x_a1UDd y_a1UDe) Double
plot_candle_centre :: Lens' (PlotCandle x_a1UDd y_a1UDe) Double
plot_candle_fill :: Lens' (PlotCandle x_a1UDd y_a1UDe) Bool
plot_candle_rise_fill_style :: Lens' (PlotCandle x_a1UDd y_a1UDe) FillStyle
plot_candle_fall_fill_style :: Lens' (PlotCandle x_a1UDd y_a1UDe) FillStyle
plot_candle_values :: Lens (PlotCandle x_a1UDd y_a1UDe) (PlotCandle x_a1UQE y_a1UQF) [Candle x_a1UDd y_a1UDe] [Candle x_a1UQE y_a1UQF]
instance (GHC.Show.Show x, GHC.Show.Show y) => GHC.Show.Show (Graphics.Rendering.Chart.Plot.Candle.Candle x y)
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.Candle.PlotCandle
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Candle.PlotCandle x y)
-- | Bar Charts
module Graphics.Rendering.Chart.Plot.Bars
-- | Value describing how to plot a set of bars. Note that the input data
-- is typed [(x,[y])], ie for each x value we plot several y values.
-- Typically the size of each [y] list would be the same.
data PlotBars x y
PlotBars :: PlotBarsStyle -> [(FillStyle, Maybe LineStyle)] -> [String] -> PlotBarsSpacing -> PlotBarsAlignment -> y -> Double -> [(x, [y])] -> PlotBars x y
-- | This value specifies whether each value from [y] should be shown
-- beside or above the previous value.
[_plot_bars_style] :: PlotBars x y -> PlotBarsStyle
-- | The style in which to draw each element of [y]. A fill style is
-- required, and if a linestyle is given, each bar will be outlined.
[_plot_bars_item_styles] :: PlotBars x y -> [(FillStyle, Maybe LineStyle)]
-- | The title of each element of [y]. These will be shown in the legend.
[_plot_bars_titles] :: PlotBars x y -> [String]
-- | This value controls how the widths of the bars are calculated. Either
-- the widths of the bars, or the gaps between them can be fixed.
[_plot_bars_spacing] :: PlotBars x y -> PlotBarsSpacing
-- | This value controls how bars for a fixed x are aligned with respect to
-- the device coordinate corresponding to x.
[_plot_bars_alignment] :: PlotBars x y -> PlotBarsAlignment
-- | The starting level for the chart (normally 0).
[_plot_bars_reference] :: PlotBars x y -> y
[_plot_bars_singleton_width] :: PlotBars x y -> Double
-- | The actual points to be plotted.
[_plot_bars_values] :: PlotBars x y -> [(x, [y])]
data PlotBarsStyle
-- | Bars for a fixed x are stacked vertically on top of each other.
BarsStacked :: PlotBarsStyle
-- | Bars for a fixed x are put horizontally beside each other.
BarsClustered :: PlotBarsStyle
data PlotBarsSpacing
-- | All bars have the same width in pixels.
BarsFixWidth :: Double -> PlotBarsSpacing
-- | (BarsFixGap g mw) means make the gaps between the bars equal to g, but
-- with a minimum bar width of mw
BarsFixGap :: Double -> Double -> PlotBarsSpacing
-- | How bars for a given (x,[y]) are aligned with respect to screen
-- coordinate corresponding to x (deviceX).
data PlotBarsAlignment
-- | The left edge of bars is at deviceX
BarsLeft :: PlotBarsAlignment
-- | Bars are centered around deviceX
BarsCentered :: PlotBarsAlignment
-- | The right edge of bars is at deviceX
BarsRight :: PlotBarsAlignment
class PlotValue a => BarsPlotValue a
barsReference :: BarsPlotValue a => a
barsAdd :: BarsPlotValue a => a -> a -> a
plotBars :: (BarsPlotValue y) => PlotBars x y -> Plot x y
plot_bars_style :: Lens' (PlotBars x_a1Y58 y_a1Y59) PlotBarsStyle
plot_bars_item_styles :: Lens' (PlotBars x_a1Y58 y_a1Y59) [(FillStyle, Maybe LineStyle)]
plot_bars_titles :: Lens' (PlotBars x_a1Y58 y_a1Y59) [String]
plot_bars_spacing :: Lens' (PlotBars x_a1Y58 y_a1Y59) PlotBarsSpacing
plot_bars_alignment :: Lens' (PlotBars x_a1Y58 y_a1Y59) PlotBarsAlignment
plot_bars_reference :: Lens' (PlotBars x_a1Y58 y_a1Y59) y_a1Y59
plot_bars_singleton_width :: Lens' (PlotBars x_a1Y58 y_a1Y59) Double
plot_bars_values :: Lens (PlotBars x_a1Y58 y_a1Y59) (PlotBars x_a1YnP y_a1Y59) [(x_a1Y58, [y_a1Y59])] [(x_a1YnP, [y_a1Y59])]
instance GHC.Show.Show Graphics.Rendering.Chart.Plot.Bars.PlotBarsAlignment
instance GHC.Show.Show Graphics.Rendering.Chart.Plot.Bars.PlotBarsSpacing
instance GHC.Show.Show Graphics.Rendering.Chart.Plot.Bars.PlotBarsStyle
instance Graphics.Rendering.Chart.Plot.Bars.BarsPlotValue GHC.Types.Double
instance Graphics.Rendering.Chart.Plot.Bars.BarsPlotValue GHC.Types.Int
instance Graphics.Rendering.Chart.Plot.Bars.BarsPlotValue y => Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Bars.PlotBars x y)
-- | Show textual annotations on a chart.
module Graphics.Rendering.Chart.Plot.Annotation
-- | Value for describing a series of text annotations to be placed at
-- arbitrary points on the graph. Annotations can be rotated and styled.
data PlotAnnotation x y
PlotAnnotation :: HTextAnchor -> VTextAnchor -> Double -> FontStyle -> [(x, y, String)] -> PlotAnnotation x y
[_plot_annotation_hanchor] :: PlotAnnotation x y -> HTextAnchor
[_plot_annotation_vanchor] :: PlotAnnotation x y -> VTextAnchor
-- | Angle, in degrees, to rotate the annotation about the anchor point.
[_plot_annotation_angle] :: PlotAnnotation x y -> Double
[_plot_annotation_style] :: PlotAnnotation x y -> FontStyle
[_plot_annotation_values] :: PlotAnnotation x y -> [(x, y, String)]
plot_annotation_hanchor :: Lens' (PlotAnnotation x_a22eU y_a22eV) HTextAnchor
plot_annotation_vanchor :: Lens' (PlotAnnotation x_a22eU y_a22eV) VTextAnchor
plot_annotation_angle :: Lens' (PlotAnnotation x_a22eU y_a22eV) Double
plot_annotation_style :: Lens' (PlotAnnotation x_a22eU y_a22eV) FontStyle
plot_annotation_values :: Lens (PlotAnnotation x_a22eU y_a22eV) (PlotAnnotation x_a22in y_a22io) [(x_a22eU, y_a22eV, String)] [(x_a22in, y_a22io, String)]
instance Graphics.Rendering.Chart.Plot.Types.ToPlot Graphics.Rendering.Chart.Plot.Annotation.PlotAnnotation
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Annotation.PlotAnnotation x y)
-- | Area spots are a collection of unconnected filled circles, with x,y
-- position, and an independent z value to be represented by the relative
-- area of the spots.
module Graphics.Rendering.Chart.Plot.AreaSpots
-- | A collection of unconnected spots, with x,y position, and an
-- independent z value to be represented by the area of the spot.
data AreaSpots z x y
AreaSpots :: String -> Double -> AlphaColour Double -> Colour Double -> Double -> Double -> [(x, y, z)] -> AreaSpots z x y
[_area_spots_title] :: AreaSpots z x y -> String
[_area_spots_linethick] :: AreaSpots z x y -> Double
[_area_spots_linecolour] :: AreaSpots z x y -> AlphaColour Double
[_area_spots_fillcolour] :: AreaSpots z x y -> Colour Double
[_area_spots_opacity] :: AreaSpots z x y -> Double
-- | the largest size of spot
[_area_spots_max_radius] :: AreaSpots z x y -> Double
[_area_spots_values] :: AreaSpots z x y -> [(x, y, z)]
area_spots_title :: Lens' (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) String
area_spots_linethick :: Lens' (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) Double
area_spots_linecolour :: Lens' (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) (AlphaColour Double)
area_spots_fillcolour :: Lens' (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) (Colour Double)
area_spots_opacity :: Lens' (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) Double
area_spots_max_radius :: Lens' (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) Double
area_spots_values :: Lens (AreaSpots z_a22XZ x_a22Y0 y_a22Y1) (AreaSpots z_a243X x_a243Y y_a243Z) [(x_a22Y0, y_a22Y1, z_a22XZ)] [(x_a243Y, y_a243Z, z_a243X)]
-- | A collection of unconnected spots, with x,y position, an independent z
-- value to be represented by the area of the spot, and in addition, a
-- fourth variable t to be represented by a colour from a given palette.
-- (A linear transfer function from t to palette is assumed.)
data AreaSpots4D z t x y
AreaSpots4D :: String -> Double -> [Colour Double] -> Double -> Double -> [(x, y, z, t)] -> AreaSpots4D z t x y
[_area_spots_4d_title] :: AreaSpots4D z t x y -> String
[_area_spots_4d_linethick] :: AreaSpots4D z t x y -> Double
[_area_spots_4d_palette] :: AreaSpots4D z t x y -> [Colour Double]
[_area_spots_4d_opacity] :: AreaSpots4D z t x y -> Double
-- | the largest size of spot
[_area_spots_4d_max_radius] :: AreaSpots4D z t x y -> Double
[_area_spots_4d_values] :: AreaSpots4D z t x y -> [(x, y, z, t)]
area_spots_4d_title :: Lens' (AreaSpots4D z_a22XV t_a22XW x_a22XX y_a22XY) String
area_spots_4d_linethick :: Lens' (AreaSpots4D z_a22XV t_a22XW x_a22XX y_a22XY) Double
area_spots_4d_palette :: Lens' (AreaSpots4D z_a22XV t_a22XW x_a22XX y_a22XY) [Colour Double]
area_spots_4d_opacity :: Lens' (AreaSpots4D z_a22XV t_a22XW x_a22XX y_a22XY) Double
area_spots_4d_max_radius :: Lens' (AreaSpots4D z_a22XV t_a22XW x_a22XX y_a22XY) Double
area_spots_4d_values :: Lens (AreaSpots4D z_a22XV t_a22XW x_a22XX y_a22XY) (AreaSpots4D z_a249q t_a249r x_a249s y_a249t) [(x_a22XX, y_a22XY, z_a22XV, t_a22XW)] [(x_a249s, y_a249t, z_a249q, t_a249r)]
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.AreaSpots.AreaSpots z x y)
instance Graphics.Rendering.Chart.Axis.Types.PlotValue z => Graphics.Rendering.Chart.Plot.Types.ToPlot (Graphics.Rendering.Chart.Plot.AreaSpots.AreaSpots z)
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.AreaSpots.AreaSpots4D z t x y)
instance (Graphics.Rendering.Chart.Axis.Types.PlotValue z, Graphics.Rendering.Chart.Axis.Types.PlotValue t, GHC.Show.Show t) => Graphics.Rendering.Chart.Plot.Types.ToPlot (Graphics.Rendering.Chart.Plot.AreaSpots.AreaSpots4D z t)
-- | A basic pie chart.
--
-- Pie charts are handled different to other plots, in that they have
-- their own layout, and can't be composed with other plots. A pie chart
-- is rendered with code in the following form:
--
-- <pre>
-- values :: [PieItem]
-- values = [...]
-- layout :: PieLayout
-- layout = pie_plot ^: pie_data ^= values
-- $ def
-- renderable = toRenderable layout
-- </pre>
module Graphics.Rendering.Chart.Plot.Pie
data PieLayout
PieLayout :: String -> FontStyle -> PieChart -> FillStyle -> Double -> PieLayout
[_pie_title] :: PieLayout -> String
[_pie_title_style] :: PieLayout -> FontStyle
[_pie_plot] :: PieLayout -> PieChart
[_pie_background] :: PieLayout -> FillStyle
[_pie_margin] :: PieLayout -> Double
data PieChart
PieChart :: [PieItem] -> [AlphaColour Double] -> FontStyle -> LineStyle -> Double -> PieChart
[_pie_data] :: PieChart -> [PieItem]
[_pie_colors] :: PieChart -> [AlphaColour Double]
[_pie_label_style] :: PieChart -> FontStyle
[_pie_label_line_style] :: PieChart -> LineStyle
[_pie_start_angle] :: PieChart -> Double
data PieItem
PieItem :: String -> Double -> Double -> PieItem
[_pitem_label] :: PieItem -> String
[_pitem_offset] :: PieItem -> Double
[_pitem_value] :: PieItem -> Double
pieToRenderable :: PieLayout -> Renderable (PickFn a)
pieChartToRenderable :: PieChart -> Renderable (PickFn a)
pie_title :: Lens' PieLayout String
pie_title_style :: Lens' PieLayout FontStyle
pie_plot :: Lens' PieLayout PieChart
pie_background :: Lens' PieLayout FillStyle
pie_margin :: Lens' PieLayout Double
pie_data :: Lens' PieChart [PieItem]
pie_colors :: Lens' PieChart [AlphaColour Double]
pie_label_style :: Lens' PieChart FontStyle
pie_label_line_style :: Lens' PieChart LineStyle
pie_start_angle :: Lens' PieChart Double
pitem_label :: Lens' PieItem String
pitem_offset :: Lens' PieItem Double
pitem_value :: Lens' PieItem Double
instance Data.Default.Class.Default Graphics.Rendering.Chart.Plot.Pie.PieChart
instance Data.Default.Class.Default Graphics.Rendering.Chart.Plot.Pie.PieItem
instance Data.Default.Class.Default Graphics.Rendering.Chart.Plot.Pie.PieLayout
instance Graphics.Rendering.Chart.Renderable.ToRenderable Graphics.Rendering.Chart.Plot.Pie.PieLayout
instance Graphics.Rendering.Chart.Renderable.ToRenderable Graphics.Rendering.Chart.Plot.Pie.PieChart
module Graphics.Rendering.Chart.Plot.Histogram
data PlotHist x y
PlotHist :: String -> Int -> [x] -> Bool -> Maybe (x, x) -> Bool -> FillStyle -> LineStyle -> (Double -> Int -> y) -> PlotHist x y
-- | Plot title
[_plot_hist_title] :: PlotHist x y -> String
-- | Number of bins
[_plot_hist_bins] :: PlotHist x y -> Int
-- | Values to histogram
[_plot_hist_values] :: PlotHist x y -> [x]
-- | Don't attempt to plot bins with zero counts. Useful when the y-axis is
-- logarithmically scaled.
[_plot_hist_no_zeros] :: PlotHist x y -> Bool
-- | Override the range of the histogram. If <tt>Nothing</tt> the range of
-- <tt>_plot_hist_values</tt> is used.
--
-- Note that any normalization is always computed over the full data set,
-- including samples not falling in the histogram range.
[_plot_hist_range] :: PlotHist x y -> Maybe (x, x)
-- | Plot vertical lines between bins
[_plot_hist_drop_lines] :: PlotHist x y -> Bool
-- | Fill style of the bins
[_plot_hist_fill_style] :: PlotHist x y -> FillStyle
-- | Line style of the bin outlines
[_plot_hist_line_style] :: PlotHist x y -> LineStyle
-- | Normalization function
[_plot_hist_norm_func] :: PlotHist x y -> Double -> Int -> y
-- | Convert a <tt>PlotHist</tt> to a <tt>Plot</tt>
--
-- N.B. In principle this should be Chart's <tt>ToPlot</tt> class but
-- unfortunately this does not allow us to set bounds on the x and y axis
-- types, hence the need for this function.
histToPlot :: (RealFrac x, Num y, Ord y) => PlotHist x y -> Plot x y
-- | The default style is an unnormalized histogram of 20 bins.
defaultPlotHist :: PlotHist x Int
-- | <tt>defaultPlotHist</tt> but with real counts
defaultFloatPlotHist :: PlotHist x Double
-- | <tt>defaultPlotHist</tt> but normalized such that the integral of the
-- histogram is one.
defaultNormedPlotHist :: PlotHist x Double
plot_hist_title :: Lens' (PlotHist x_a2cI0 y_a2cI1) String
plot_hist_bins :: Lens' (PlotHist x_a2cI0 y_a2cI1) Int
plot_hist_values :: Lens' (PlotHist x_a2cI0 y_a2cI1) [x_a2cI0]
plot_hist_no_zeros :: Lens' (PlotHist x_a2cI0 y_a2cI1) Bool
plot_hist_range :: Lens' (PlotHist x_a2cI0 y_a2cI1) (Maybe (x_a2cI0, x_a2cI0))
plot_hist_drop_lines :: Lens' (PlotHist x_a2cI0 y_a2cI1) Bool
plot_hist_line_style :: Lens' (PlotHist x_a2cI0 y_a2cI1) LineStyle
plot_hist_fill_style :: Lens' (PlotHist x_a2cI0 y_a2cI1) FillStyle
plot_hist_norm_func :: Lens (PlotHist x_a2cI0 y_a2cI1) (PlotHist x_a2cI0 y_a2cWO) (Double -> Int -> y_a2cI1) (Double -> Int -> y_a2cWO)
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Plot.Histogram.PlotHist x GHC.Types.Int)
-- | Code to calculate and render various types of plots.
module Graphics.Rendering.Chart.Plot
-- | This module glues together axes and plots to actually create a
-- renderable for a chart.
--
-- Note that Template haskell is used to derive accessor functions (see
-- <a>Lens</a>) for each field of the following data types:
--
-- <ul>
-- <li><a>Layout</a></li>
-- <li><a>LayoutLR</a></li>
-- <li><a>StackedLayouts</a></li>
-- <li><a>LayoutAxis</a></li>
-- </ul>
module Graphics.Rendering.Chart.Layout
-- | A Layout value is a single plot area, with single x and y axis. The
-- title is at the top and the legend at the bottom. It's parametrized by
-- the types of values to be plotted on the x and y axes.
data Layout x y
Layout :: FillStyle -> Maybe FillStyle -> String -> FontStyle -> LayoutAxis x -> AxisVisibility -> AxisVisibility -> LayoutAxis y -> AxisVisibility -> AxisVisibility -> [Plot x y] -> Maybe LegendStyle -> Double -> Bool -> Layout x y
-- | How to fill the background of everything.
[_layout_background] :: Layout x y -> FillStyle
-- | How to fill the background of the plot, if different from the overall
-- background.
[_layout_plot_background] :: Layout x y -> Maybe FillStyle
-- | Title to display above the chart.
[_layout_title] :: Layout x y -> String
-- | Font style to use for the title.
[_layout_title_style] :: Layout x y -> FontStyle
-- | Rules to generate the x axis.
[_layout_x_axis] :: Layout x y -> LayoutAxis x
-- | Visibility options for the top axis.
[_layout_top_axis_visibility] :: Layout x y -> AxisVisibility
-- | Visibility options for the bottom axis.
[_layout_bottom_axis_visibility] :: Layout x y -> AxisVisibility
-- | Rules to generate the y axis.
[_layout_y_axis] :: Layout x y -> LayoutAxis y
-- | Visibility options for the left axis.
[_layout_left_axis_visibility] :: Layout x y -> AxisVisibility
-- | Visibility options for the right axis.
[_layout_right_axis_visibility] :: Layout x y -> AxisVisibility
-- | The data sets to plot in the chart. The are ploted over each other.
[_layout_plots] :: Layout x y -> [Plot x y]
-- | How to style the legend.
[_layout_legend] :: Layout x y -> Maybe LegendStyle
-- | The margin distance to use.
[_layout_margin] :: Layout x y -> Double
-- | If the grid shall be rendered beneath (<tt>False</tt>) or over
-- (<tt>True</tt>) all plots.
[_layout_grid_last] :: Layout x y -> Bool
-- | A LayoutLR value is a single plot area, with an x axis and independent
-- left and right y axes, with a title at the top; legend at the bottom.
-- It's parametrized by the types of values to be plotted on the x and
-- two y axes.
data LayoutLR x y1 y2
LayoutLR :: FillStyle -> Maybe FillStyle -> String -> FontStyle -> LayoutAxis x -> AxisVisibility -> AxisVisibility -> LayoutAxis y1 -> AxisVisibility -> LayoutAxis y2 -> AxisVisibility -> [Either (Plot x y1) (Plot x y2)] -> Maybe LegendStyle -> Double -> Bool -> LayoutLR x y1 y2
-- | How to fill the background of everything.
[_layoutlr_background] :: LayoutLR x y1 y2 -> FillStyle
-- | How to fill the background of the plot, if different from the overall
-- background.
[_layoutlr_plot_background] :: LayoutLR x y1 y2 -> Maybe FillStyle
-- | Title to display above the chart.
[_layoutlr_title] :: LayoutLR x y1 y2 -> String
-- | Font style to use for the title.
[_layoutlr_title_style] :: LayoutLR x y1 y2 -> FontStyle
-- | Rules to generate the x axis.
[_layoutlr_x_axis] :: LayoutLR x y1 y2 -> LayoutAxis x
-- | Visibility options for the top axis.
[_layoutlr_top_axis_visibility] :: LayoutLR x y1 y2 -> AxisVisibility
-- | Visibility options for the bottom axis.
[_layoutlr_bottom_axis_visibility] :: LayoutLR x y1 y2 -> AxisVisibility
-- | Rules to generate the left y axis.
[_layoutlr_left_axis] :: LayoutLR x y1 y2 -> LayoutAxis y1
-- | Visibility options for the left axis.
[_layoutlr_left_axis_visibility] :: LayoutLR x y1 y2 -> AxisVisibility
-- | Rules to generate the right y axis.
[_layoutlr_right_axis] :: LayoutLR x y1 y2 -> LayoutAxis y2
-- | Visibility options for the right axis.
[_layoutlr_right_axis_visibility] :: LayoutLR x y1 y2 -> AxisVisibility
-- | The data sets to plot in the chart. The are ploted over each other.
-- The either type associates the plot with the left or right y axis.
[_layoutlr_plots] :: LayoutLR x y1 y2 -> [Either (Plot x y1) (Plot x y2)]
-- | How to style the legend.
[_layoutlr_legend] :: LayoutLR x y1 y2 -> Maybe LegendStyle
-- | The margin distance to use.
[_layoutlr_margin] :: LayoutLR x y1 y2 -> Double
-- | If the grid shall be rendered beneath (<tt>False</tt>) or over
-- (<tt>True</tt>) all plots.
[_layoutlr_grid_last] :: LayoutLR x y1 y2 -> Bool
-- | Type of axis that is used in <a>Layout</a> and <a>LayoutLR</a>.
--
-- To generate the actual axis type (<a>AxisData</a> and <a>AxisT</a>)
-- the <a>_laxis_generate</a> function is called and custom settings are
-- applied with <a>_laxis_override</a>. Note that the
-- <a>AxisVisibility</a> values in <a>Layout</a> and <a>LayoutLR</a>
-- override visibility related settings of the axis.
data LayoutAxis x
LayoutAxis :: FontStyle -> String -> AxisStyle -> AxisFn x -> (AxisData x -> AxisData x) -> Bool -> LayoutAxis x
-- | Font style to use for the axis title.
[_laxis_title_style] :: LayoutAxis x -> FontStyle
-- | Title displayed for the axis.
[_laxis_title] :: LayoutAxis x -> String
-- | Axis style applied.
[_laxis_style] :: LayoutAxis x -> AxisStyle
-- | Function that generates the axis data, based upon the points plotted.
-- The default value is <a>autoAxis</a>.
[_laxis_generate] :: LayoutAxis x -> AxisFn x
-- | Function that can be used to override the generated axis data. The
-- default value is <a>id</a>.
[_laxis_override] :: LayoutAxis x -> AxisData x -> AxisData x
-- | True if left to right (bottom to top) is to show descending values.
[_laxis_reverse] :: LayoutAxis x -> Bool
-- | Information on what is at a specifc location of a <a>Layout</a> or
-- <a>LayoutLR</a>. This is delivered by the <a>PickFn</a> of a
-- <a>Renderable</a>.
data LayoutPick x y1 y2
-- | A legend entry.
LayoutPick_Legend :: String -> LayoutPick x y1 y2
-- | The title.
LayoutPick_Title :: String -> LayoutPick x y1 y2
-- | The title of the top x axis.
LayoutPick_XTopAxisTitle :: String -> LayoutPick x y1 y2
-- | The title of the bottom x axis.
LayoutPick_XBottomAxisTitle :: String -> LayoutPick x y1 y2
-- | The title of the left y axis.
LayoutPick_YLeftAxisTitle :: String -> LayoutPick x y1 y2
-- | The title of the right y axis.
LayoutPick_YRightAxisTitle :: String -> LayoutPick x y1 y2
-- | The plot area at the given plot coordinates.
LayoutPick_PlotArea :: x -> y1 -> y2 -> LayoutPick x y1 y2
-- | The top x axis at the given plot coordinate.
LayoutPick_XTopAxis :: x -> LayoutPick x y1 y2
-- | The bottom x axis at the given plot coordinate.
LayoutPick_XBottomAxis :: x -> LayoutPick x y1 y2
-- | The left y axis at the given plot coordinate.
LayoutPick_YLeftAxis :: y1 -> LayoutPick x y1 y2
-- | The right y axis at the given plot coordinate.
LayoutPick_YRightAxis :: y2 -> LayoutPick x y1 y2
-- | A container for a set of vertically <a>StackedLayout</a>s. The x axis
-- of the different layouts will be aligned.
data StackedLayouts x
StackedLayouts :: [StackedLayout x] -> Bool -> StackedLayouts x
-- | The stacked layouts from top (first element) to bottom (last element).
[_slayouts_layouts] :: StackedLayouts x -> [StackedLayout x]
-- | If the different legends shall be combined in one legend at the
-- bottom.
[_slayouts_compress_legend] :: StackedLayouts x -> Bool
-- | A layout with its y type hidden, so that it can be stacked with other
-- layouts with differing y axis, but the same x axis. See
-- <a>StackedLayouts</a>.
data StackedLayout x
-- | A <a>Layout</a> to stack.
StackedLayout :: (Layout x y) -> StackedLayout x
-- | A <a>LayoutLR</a> to stack.
StackedLayoutLR :: (LayoutLR x yl yr) -> StackedLayout x
-- | A <tt>MAxisFn</tt> is a function that generates an (optional) axis
-- given the points plotted against that axis.
type MAxisFn t = [t] -> Maybe (AxisData t)
-- | Render the given <a>Layout</a>.
layoutToRenderable :: (Ord x, Ord y) => Layout x y -> Renderable (LayoutPick x y y)
-- | Render the given <a>LayoutLR</a>.
layoutLRToRenderable :: (Ord x, Ord yl, Ord yr) => LayoutLR x yl yr -> Renderable (LayoutPick x yl yr)
-- | Render several layouts with the same x-axis type and range, vertically
-- stacked so that their origins and x-values are aligned.
--
-- The legends from all the charts may be optionally combined, and shown
-- once on the bottom chart. See <a>StackedLayouts</a> for further
-- information.
renderStackedLayouts :: (Ord x) => StackedLayouts x -> Renderable ()
laxis_title_style :: Lens' (LayoutAxis x_a2gOX) FontStyle
laxis_title :: Lens' (LayoutAxis x_a2gOX) String
laxis_style :: Lens' (LayoutAxis x_a2gOX) AxisStyle
laxis_generate :: Lens' (LayoutAxis x_a2gOX) (AxisFn x_a2gOX)
laxis_override :: Lens' (LayoutAxis x_a2gOX) (AxisData x_a2gOX -> AxisData x_a2gOX)
laxis_reverse :: Lens' (LayoutAxis x_a2gOX) Bool
layout_background :: Lens' (Layout x_a2gOS y_a2gOT) FillStyle
layout_plot_background :: Lens' (Layout x_a2gOS y_a2gOT) (Maybe FillStyle)
layout_title :: Lens' (Layout x_a2gOS y_a2gOT) String
layout_title_style :: Lens' (Layout x_a2gOS y_a2gOT) FontStyle
layout_x_axis :: Lens' (Layout x_a2gOS y_a2gOT) (LayoutAxis x_a2gOS)
layout_top_axis_visibility :: Lens' (Layout x_a2gOS y_a2gOT) AxisVisibility
layout_bottom_axis_visibility :: Lens' (Layout x_a2gOS y_a2gOT) AxisVisibility
layout_y_axis :: Lens' (Layout x_a2gOS y_a2gOT) (LayoutAxis y_a2gOT)
layout_left_axis_visibility :: Lens' (Layout x_a2gOS y_a2gOT) AxisVisibility
layout_right_axis_visibility :: Lens' (Layout x_a2gOS y_a2gOT) AxisVisibility
layout_margin :: Lens' (Layout x_a2gOS y_a2gOT) Double
layout_plots :: Lens' (Layout x_a2gOS y_a2gOT) [Plot x_a2gOS y_a2gOT]
layout_legend :: Lens' (Layout x_a2gOS y_a2gOT) (Maybe LegendStyle)
layout_grid_last :: Lens' (Layout x_a2gOS y_a2gOT) Bool
-- | Setter to update all axis styles on a <a>Layout</a>
layout_axes_styles :: Setter' (Layout x y) AxisStyle
-- | Setter to update all the axes title styles on a <a>Layout</a>
layout_axes_title_styles :: Setter' (Layout x y) FontStyle
-- | Setter to update all the font styles on a <a>Layout</a>
layout_all_font_styles :: Setter' (Layout x y) FontStyle
-- | Setter to update the foreground color of core chart elements on a
-- <a>Layout</a>
layout_foreground :: Setter' (Layout x y) (AlphaColour Double)
layoutlr_background :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) FillStyle
layoutlr_plot_background :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) (Maybe FillStyle)
layoutlr_title :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) String
layoutlr_title_style :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) FontStyle
layoutlr_x_axis :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) (LayoutAxis x_a2gOP)
layoutlr_top_axis_visibility :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) AxisVisibility
layoutlr_bottom_axis_visibility :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) AxisVisibility
layoutlr_left_axis :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) (LayoutAxis y1_a2gOQ)
layoutlr_right_axis :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) (LayoutAxis y2_a2gOR)
layoutlr_left_axis_visibility :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) AxisVisibility
layoutlr_right_axis_visibility :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) AxisVisibility
layoutlr_plots :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) [Either (Plot x_a2gOP y1_a2gOQ) (Plot x_a2gOP y2_a2gOR)]
layoutlr_legend :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) (Maybe LegendStyle)
layoutlr_margin :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) Double
layoutlr_grid_last :: Lens' (LayoutLR x_a2gOP y1_a2gOQ y2_a2gOR) Bool
-- | Setter to update all axis styles on a <a>LayoutLR</a>
layoutlr_axes_styles :: Setter' (LayoutLR x y1 y2) AxisStyle
-- | Setter to update all the axes title styles on a <a>LayoutLR</a>
layoutlr_axes_title_styles :: Setter' (LayoutLR x y1 y2) FontStyle
-- | Setter to update all the font styles on a <a>LayoutLR</a>
layoutlr_all_font_styles :: Setter' (LayoutLR x y1 y2) FontStyle
-- | Setter to update the foreground color of core chart elements on a
-- <a>LayoutLR</a>
layoutlr_foreground :: Setter' (LayoutLR x y1 y2) (AlphaColour Double)
slayouts_layouts :: Lens (StackedLayouts x_a2gOK) (StackedLayouts x_a2is8) [StackedLayout x_a2gOK] [StackedLayout x_a2is8]
slayouts_compress_legend :: Lens' (StackedLayouts x_a2gOK) Bool
instance (GHC.Show.Show x, GHC.Show.Show y1, GHC.Show.Show y2) => GHC.Show.Show (Graphics.Rendering.Chart.Layout.LayoutPick x y1 y2)
instance (GHC.Classes.Ord x, GHC.Classes.Ord y) => Graphics.Rendering.Chart.Renderable.ToRenderable (Graphics.Rendering.Chart.Layout.Layout x y)
instance (Graphics.Rendering.Chart.Axis.Types.PlotValue x, Graphics.Rendering.Chart.Axis.Types.PlotValue y) => Data.Default.Class.Default (Graphics.Rendering.Chart.Layout.Layout x y)
instance (GHC.Classes.Ord x, GHC.Classes.Ord yl, GHC.Classes.Ord yr) => Graphics.Rendering.Chart.Renderable.ToRenderable (Graphics.Rendering.Chart.Layout.LayoutLR x yl yr)
instance Data.Default.Class.Default (Graphics.Rendering.Chart.Layout.StackedLayouts x)
instance GHC.Classes.Ord x => Graphics.Rendering.Chart.Renderable.ToRenderable (Graphics.Rendering.Chart.Layout.StackedLayouts x)
instance (Graphics.Rendering.Chart.Axis.Types.PlotValue x, Graphics.Rendering.Chart.Axis.Types.PlotValue y1, Graphics.Rendering.Chart.Axis.Types.PlotValue y2) => Data.Default.Class.Default (Graphics.Rendering.Chart.Layout.LayoutLR x y1 y2)
instance Graphics.Rendering.Chart.Axis.Types.PlotValue t => Data.Default.Class.Default (Graphics.Rendering.Chart.Layout.LayoutAxis t)
-- | Sparklines are mini graphs inspired by Edward Tufte; see
-- <a>http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR</a>
-- and <a>http://en.wikipedia.org/wiki/Sparkline</a> for more
-- information.
--
-- The original implementation (by Hitesh Jasani) used the gd package as
-- a backend renderer, and is still available at
-- <a>http://hackage.haskell.org/package/hsparklines</a>.
--
-- The present version integrates with the Chart package, in the sense
-- that Sparklines are just another kind of (<tt>ToRenderable a =>
-- a</tt>), so they can be composed into grids and used with the rest of
-- Chart.
--
-- <pre>
-- dp :: [Double]
-- dp = [24,21,32.3,24,15,34,43,55,57,72,74,75,73,72,55,44]
--
-- sl = SparkLine barSpark dp
-- fopts = FileOptions (sparkSize sl) PNG
-- renderableToFile fopts (sparkLineToRenderable sl) "bar_spark.png"
-- </pre>
module Graphics.Rendering.Chart.SparkLine
-- | A sparkline is a single sequence of data values, treated as y-values.
-- The x-values are anonymous and implicit in the sequence.
data SparkLine
SparkLine :: SparkOptions -> [Double] -> SparkLine
[sl_options] :: SparkLine -> SparkOptions
[sl_data] :: SparkLine -> [Double]
-- | Options to render the sparklines in different ways.
data SparkOptions
SparkOptions :: Bool -> Int -> Int -> (Double, Double) -> Colour Double -> Colour Double -> Colour Double -> Colour Double -> Bool -> Bool -> Bool -> SparkOptions
-- | smooth or bars
[so_smooth] :: SparkOptions -> Bool
-- | step size
[so_step] :: SparkOptions -> Int
-- | graph height (pixels)
[so_height] :: SparkOptions -> Int
-- | data point limits
[so_limits] :: SparkOptions -> (Double, Double)
-- | background color
[so_bgColor] :: SparkOptions -> Colour Double
-- | color of minimum datapoint
[so_minColor] :: SparkOptions -> Colour Double
-- | color of maximum datapoint
[so_maxColor] :: SparkOptions -> Colour Double
-- | color of last datapoint
[so_lastColor] :: SparkOptions -> Colour Double
-- | display minimum marker
[so_minMarker] :: SparkOptions -> Bool
-- | display maximum marker
[so_maxMarker] :: SparkOptions -> Bool
-- | display last marker
[so_lastMarker] :: SparkOptions -> Bool
-- | Default options for a smooth sparkline.
smoothSpark :: SparkOptions
-- | Default options for a barchart sparkline.
barSpark :: SparkOptions
-- | Return the width and height of the SparkLine.
sparkSize :: SparkLine -> (Int, Int)
-- | Render a SparkLine to a drawing surface.
renderSparkLine :: SparkLine -> ChartBackend (PickFn ())
-- | Create a renderable from a SparkLine.
sparkLineToRenderable :: SparkLine -> Renderable ()
-- | Compute the width of a SparkLine, for rendering purposes.
sparkWidth :: SparkLine -> Int
instance GHC.Show.Show Graphics.Rendering.Chart.SparkLine.SparkOptions
instance Graphics.Rendering.Chart.Renderable.ToRenderable Graphics.Rendering.Chart.SparkLine.SparkLine
module Graphics.Rendering.Chart.State
-- | Add a plot to the <a>Layout</a> being constructed.
plot :: (ToPlot p) => EC (Layout x y) (p x y) -> EC (Layout x y) ()
-- | Add a plot against the left axis to the <a>LayoutLR</a> being
-- constructed.
plotLeft :: (ToPlot p) => EC (LayoutLR x y1 y2) (p x y1) -> EC (LayoutLR x y1 y2) ()
-- | Add a plot against the right axis tof the <a>LayoutLR</a> being
-- constructed.
plotRight :: (ToPlot p) => EC (LayoutLR x y1 y2) (p x y2) -> EC (LayoutLR x y1 y2) ()
-- | Pop and return the next color from the state
takeColor :: EC l (AlphaColour Double)
-- | Pop and return the next shape from the state
takeShape :: EC l PointShape
-- | The state held when monadically constructing a graphical element
data CState
colors :: Lens' CState [AlphaColour Double]
shapes :: Lens' CState [PointShape]
-- | We use nested State monads to give nice syntax. The outer state is the
-- graphical element being constructed (typically a layout). The inner
-- state contains any additional state reqired. This approach means that
-- lenses and the state monad lens operators can be used directly on the
-- value being constructed.
type EC l a = StateT l (State CState) a
-- | Run the monadic <a>EC</a> computation, and return the graphical
-- element (ie the outer monad' state)
execEC :: (Default l) => EC l a -> l
-- | Nest the construction of a graphical element within the construction
-- of another.
liftEC :: (Default l1) => EC l1 a -> EC l2 l1
-- | Lift a a computation over <a>CState</a>
liftCState :: State CState a -> EC l a
instance Data.Default.Class.Default Graphics.Rendering.Chart.State.CState
instance (Data.Default.Class.Default a, Graphics.Rendering.Chart.Renderable.ToRenderable a) => Graphics.Rendering.Chart.Renderable.ToRenderable (Graphics.Rendering.Chart.State.EC a b)
-- | A framework for creating 2D charts in Haskell.
--
-- For the simplest API, see the <a>Graphics.Rendering.Chart.Easy</a>
-- module.
--
-- When more control is required, understanding the various data types is
-- necessary. The basic model is that you define a value representing a
-- chart to be displayed (eg. a <a>Layout</a>), and then convert it to a
-- <a>Renderable</a> by applying <a>toRenderable</a>. This
-- <a>Renderable</a> is then actually output by calling a function in an
-- appropriate graphics backend, eg <tt>renderableToFile</tt>.
--
-- Currently, there are three types of charts:
--
-- <ul>
-- <li><a>Layout</a> is a standard XY chart</li>
-- <li><a>LayoutLR</a> is an XY chart with independent left and right
-- axes</li>
-- <li><a>PieLayout</a> is a pie chart</li>
-- </ul>
--
-- <a>Layout</a> and <a>LayoutLR</a> charts can be stacked vertically
-- using the <a>StackedLayouts</a> type.
--
-- <a>Renderable</a>s can be composed in arbitrary ways using the
-- <a>Graphics.Rendering.Chart.Grid</a> module.
--
-- Many of the record structure involved in the API have a large number
-- of fields. <tt>Lens</tt>es are provided to access each field. Also,
-- for each record type, there is generally a default value, which can be
-- accessed through the <tt>def</tt> value of the <tt>Default</tt>
-- typeclass.
module Graphics.Rendering.Chart
-- | A high level API for generating a plot quickly.
--
-- Importing the Easy module brings into scope all core functions and
-- types required for working with the chart library. This includes key
-- external dependencies such as Control.Len and Data.Colour. The module
-- also provides several helper functions for quickly generating common
-- plots. Note that chart backends must still be explicitly imported, as
-- some backends cannot be built on all platforms.
--
-- Example usage:
--
-- <pre>
-- import Graphics.Rendering.Chart.Easy
-- import Graphics.Rendering.Chart.Backend.Cairo
--
-- signal :: [Double] -> [(Double,Double)]
-- signal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * (sin (x*3.14159/5))) | x <- xs ]
--
-- main = toFile def "example.png" $ do
-- layout_title .= "Amplitude Modulation"
-- plot (line "am" [signal [0,(0.5)..400]])
-- plot (points "am points" (signal [0,7..400]))
-- </pre>
--
-- More examples can be found on the <a>library's wiki</a>
module Graphics.Rendering.Chart.Easy
-- | Constuct a line plot with the given title and data, using the next
-- available color.
line :: String -> [[(x, y)]] -> EC l (PlotLines x y)
-- | Construct a scatter plot with the given title and data, using the next
-- available color and point shape.
points :: String -> [(x, y)] -> EC l (PlotPoints x y)
-- | Construct a bar chart with the given titles and data, using the next
-- available colors
bars :: (PlotValue x, BarsPlotValue y) => [String] -> [(x, [y])] -> EC l (PlotBars x y)
-- | Set the contents of the colour source, for subsequent plots
setColors :: [AlphaColour Double] -> EC l ()
-- | Set the contents of the shape source, for subsequent plots
setShapes :: [PointShape] -> EC l ()
|