1from plotly.basedatatypes import BaseTraceType as _BaseTraceType 2import copy as _copy 3 4 5class Candlestick(_BaseTraceType): 6 7 # class properties 8 # -------------------- 9 _parent_path_str = "" 10 _path_str = "candlestick" 11 _valid_props = { 12 "close", 13 "closesrc", 14 "customdata", 15 "customdatasrc", 16 "decreasing", 17 "high", 18 "highsrc", 19 "hoverinfo", 20 "hoverinfosrc", 21 "hoverlabel", 22 "hovertext", 23 "hovertextsrc", 24 "ids", 25 "idssrc", 26 "increasing", 27 "legendgroup", 28 "line", 29 "low", 30 "lowsrc", 31 "meta", 32 "metasrc", 33 "name", 34 "opacity", 35 "open", 36 "opensrc", 37 "selectedpoints", 38 "showlegend", 39 "stream", 40 "text", 41 "textsrc", 42 "type", 43 "uid", 44 "uirevision", 45 "visible", 46 "whiskerwidth", 47 "x", 48 "xaxis", 49 "xcalendar", 50 "xperiod", 51 "xperiod0", 52 "xperiodalignment", 53 "xsrc", 54 "yaxis", 55 } 56 57 # close 58 # ----- 59 @property 60 def close(self): 61 """ 62 Sets the close values. 63 64 The 'close' property is an array that may be specified as a tuple, 65 list, numpy array, or pandas Series 66 67 Returns 68 ------- 69 numpy.ndarray 70 """ 71 return self["close"] 72 73 @close.setter 74 def close(self, val): 75 self["close"] = val 76 77 # closesrc 78 # -------- 79 @property 80 def closesrc(self): 81 """ 82 Sets the source reference on Chart Studio Cloud for close . 83 84 The 'closesrc' property must be specified as a string or 85 as a plotly.grid_objs.Column object 86 87 Returns 88 ------- 89 str 90 """ 91 return self["closesrc"] 92 93 @closesrc.setter 94 def closesrc(self, val): 95 self["closesrc"] = val 96 97 # customdata 98 # ---------- 99 @property 100 def customdata(self): 101 """ 102 Assigns extra data each datum. This may be useful when 103 listening to hover, click and selection events. Note that, 104 "scatter" traces also appends customdata items in the markers 105 DOM elements 106 107 The 'customdata' property is an array that may be specified as a tuple, 108 list, numpy array, or pandas Series 109 110 Returns 111 ------- 112 numpy.ndarray 113 """ 114 return self["customdata"] 115 116 @customdata.setter 117 def customdata(self, val): 118 self["customdata"] = val 119 120 # customdatasrc 121 # ------------- 122 @property 123 def customdatasrc(self): 124 """ 125 Sets the source reference on Chart Studio Cloud for customdata 126 . 127 128 The 'customdatasrc' property must be specified as a string or 129 as a plotly.grid_objs.Column object 130 131 Returns 132 ------- 133 str 134 """ 135 return self["customdatasrc"] 136 137 @customdatasrc.setter 138 def customdatasrc(self, val): 139 self["customdatasrc"] = val 140 141 # decreasing 142 # ---------- 143 @property 144 def decreasing(self): 145 """ 146 The 'decreasing' property is an instance of Decreasing 147 that may be specified as: 148 - An instance of :class:`plotly.graph_objs.candlestick.Decreasing` 149 - A dict of string/value properties that will be passed 150 to the Decreasing constructor 151 152 Supported dict properties: 153 154 fillcolor 155 Sets the fill color. Defaults to a half- 156 transparent variant of the line color, marker 157 color, or marker line color, whichever is 158 available. 159 line 160 :class:`plotly.graph_objects.candlestick.decrea 161 sing.Line` instance or dict with compatible 162 properties 163 164 Returns 165 ------- 166 plotly.graph_objs.candlestick.Decreasing 167 """ 168 return self["decreasing"] 169 170 @decreasing.setter 171 def decreasing(self, val): 172 self["decreasing"] = val 173 174 # high 175 # ---- 176 @property 177 def high(self): 178 """ 179 Sets the high values. 180 181 The 'high' property is an array that may be specified as a tuple, 182 list, numpy array, or pandas Series 183 184 Returns 185 ------- 186 numpy.ndarray 187 """ 188 return self["high"] 189 190 @high.setter 191 def high(self, val): 192 self["high"] = val 193 194 # highsrc 195 # ------- 196 @property 197 def highsrc(self): 198 """ 199 Sets the source reference on Chart Studio Cloud for high . 200 201 The 'highsrc' property must be specified as a string or 202 as a plotly.grid_objs.Column object 203 204 Returns 205 ------- 206 str 207 """ 208 return self["highsrc"] 209 210 @highsrc.setter 211 def highsrc(self, val): 212 self["highsrc"] = val 213 214 # hoverinfo 215 # --------- 216 @property 217 def hoverinfo(self): 218 """ 219 Determines which trace information appear on hover. If `none` 220 or `skip` are set, no information is displayed upon hovering. 221 But, if `none` is set, click and hover events are still fired. 222 223 The 'hoverinfo' property is a flaglist and may be specified 224 as a string containing: 225 - Any combination of ['x', 'y', 'z', 'text', 'name'] joined with '+' characters 226 (e.g. 'x+y') 227 OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip') 228 - A list or array of the above 229 230 Returns 231 ------- 232 Any|numpy.ndarray 233 """ 234 return self["hoverinfo"] 235 236 @hoverinfo.setter 237 def hoverinfo(self, val): 238 self["hoverinfo"] = val 239 240 # hoverinfosrc 241 # ------------ 242 @property 243 def hoverinfosrc(self): 244 """ 245 Sets the source reference on Chart Studio Cloud for hoverinfo 246 . 247 248 The 'hoverinfosrc' property must be specified as a string or 249 as a plotly.grid_objs.Column object 250 251 Returns 252 ------- 253 str 254 """ 255 return self["hoverinfosrc"] 256 257 @hoverinfosrc.setter 258 def hoverinfosrc(self, val): 259 self["hoverinfosrc"] = val 260 261 # hoverlabel 262 # ---------- 263 @property 264 def hoverlabel(self): 265 """ 266 The 'hoverlabel' property is an instance of Hoverlabel 267 that may be specified as: 268 - An instance of :class:`plotly.graph_objs.candlestick.Hoverlabel` 269 - A dict of string/value properties that will be passed 270 to the Hoverlabel constructor 271 272 Supported dict properties: 273 274 align 275 Sets the horizontal alignment of the text 276 content within hover label box. Has an effect 277 only if the hover label text spans more two or 278 more lines 279 alignsrc 280 Sets the source reference on Chart Studio Cloud 281 for align . 282 bgcolor 283 Sets the background color of the hover labels 284 for this trace 285 bgcolorsrc 286 Sets the source reference on Chart Studio Cloud 287 for bgcolor . 288 bordercolor 289 Sets the border color of the hover labels for 290 this trace. 291 bordercolorsrc 292 Sets the source reference on Chart Studio Cloud 293 for bordercolor . 294 font 295 Sets the font used in hover labels. 296 namelength 297 Sets the default length (in number of 298 characters) of the trace name in the hover 299 labels for all traces. -1 shows the whole name 300 regardless of length. 0-3 shows the first 0-3 301 characters, and an integer >3 will show the 302 whole name if it is less than that many 303 characters, but if it is longer, will truncate 304 to `namelength - 3` characters and add an 305 ellipsis. 306 namelengthsrc 307 Sets the source reference on Chart Studio Cloud 308 for namelength . 309 split 310 Show hover information (open, close, high, low) 311 in separate labels. 312 313 Returns 314 ------- 315 plotly.graph_objs.candlestick.Hoverlabel 316 """ 317 return self["hoverlabel"] 318 319 @hoverlabel.setter 320 def hoverlabel(self, val): 321 self["hoverlabel"] = val 322 323 # hovertext 324 # --------- 325 @property 326 def hovertext(self): 327 """ 328 Same as `text`. 329 330 The 'hovertext' property is a string and must be specified as: 331 - A string 332 - A number that will be converted to a string 333 - A tuple, list, or one-dimensional numpy array of the above 334 335 Returns 336 ------- 337 str|numpy.ndarray 338 """ 339 return self["hovertext"] 340 341 @hovertext.setter 342 def hovertext(self, val): 343 self["hovertext"] = val 344 345 # hovertextsrc 346 # ------------ 347 @property 348 def hovertextsrc(self): 349 """ 350 Sets the source reference on Chart Studio Cloud for hovertext 351 . 352 353 The 'hovertextsrc' property must be specified as a string or 354 as a plotly.grid_objs.Column object 355 356 Returns 357 ------- 358 str 359 """ 360 return self["hovertextsrc"] 361 362 @hovertextsrc.setter 363 def hovertextsrc(self, val): 364 self["hovertextsrc"] = val 365 366 # ids 367 # --- 368 @property 369 def ids(self): 370 """ 371 Assigns id labels to each datum. These ids for object constancy 372 of data points during animation. Should be an array of strings, 373 not numbers or any other type. 374 375 The 'ids' property is an array that may be specified as a tuple, 376 list, numpy array, or pandas Series 377 378 Returns 379 ------- 380 numpy.ndarray 381 """ 382 return self["ids"] 383 384 @ids.setter 385 def ids(self, val): 386 self["ids"] = val 387 388 # idssrc 389 # ------ 390 @property 391 def idssrc(self): 392 """ 393 Sets the source reference on Chart Studio Cloud for ids . 394 395 The 'idssrc' property must be specified as a string or 396 as a plotly.grid_objs.Column object 397 398 Returns 399 ------- 400 str 401 """ 402 return self["idssrc"] 403 404 @idssrc.setter 405 def idssrc(self, val): 406 self["idssrc"] = val 407 408 # increasing 409 # ---------- 410 @property 411 def increasing(self): 412 """ 413 The 'increasing' property is an instance of Increasing 414 that may be specified as: 415 - An instance of :class:`plotly.graph_objs.candlestick.Increasing` 416 - A dict of string/value properties that will be passed 417 to the Increasing constructor 418 419 Supported dict properties: 420 421 fillcolor 422 Sets the fill color. Defaults to a half- 423 transparent variant of the line color, marker 424 color, or marker line color, whichever is 425 available. 426 line 427 :class:`plotly.graph_objects.candlestick.increa 428 sing.Line` instance or dict with compatible 429 properties 430 431 Returns 432 ------- 433 plotly.graph_objs.candlestick.Increasing 434 """ 435 return self["increasing"] 436 437 @increasing.setter 438 def increasing(self, val): 439 self["increasing"] = val 440 441 # legendgroup 442 # ----------- 443 @property 444 def legendgroup(self): 445 """ 446 Sets the legend group for this trace. Traces part of the same 447 legend group hide/show at the same time when toggling legend 448 items. 449 450 The 'legendgroup' property is a string and must be specified as: 451 - A string 452 - A number that will be converted to a string 453 454 Returns 455 ------- 456 str 457 """ 458 return self["legendgroup"] 459 460 @legendgroup.setter 461 def legendgroup(self, val): 462 self["legendgroup"] = val 463 464 # line 465 # ---- 466 @property 467 def line(self): 468 """ 469 The 'line' property is an instance of Line 470 that may be specified as: 471 - An instance of :class:`plotly.graph_objs.candlestick.Line` 472 - A dict of string/value properties that will be passed 473 to the Line constructor 474 475 Supported dict properties: 476 477 width 478 Sets the width (in px) of line bounding the 479 box(es). Note that this style setting can also 480 be set per direction via 481 `increasing.line.width` and 482 `decreasing.line.width`. 483 484 Returns 485 ------- 486 plotly.graph_objs.candlestick.Line 487 """ 488 return self["line"] 489 490 @line.setter 491 def line(self, val): 492 self["line"] = val 493 494 # low 495 # --- 496 @property 497 def low(self): 498 """ 499 Sets the low values. 500 501 The 'low' property is an array that may be specified as a tuple, 502 list, numpy array, or pandas Series 503 504 Returns 505 ------- 506 numpy.ndarray 507 """ 508 return self["low"] 509 510 @low.setter 511 def low(self, val): 512 self["low"] = val 513 514 # lowsrc 515 # ------ 516 @property 517 def lowsrc(self): 518 """ 519 Sets the source reference on Chart Studio Cloud for low . 520 521 The 'lowsrc' property must be specified as a string or 522 as a plotly.grid_objs.Column object 523 524 Returns 525 ------- 526 str 527 """ 528 return self["lowsrc"] 529 530 @lowsrc.setter 531 def lowsrc(self, val): 532 self["lowsrc"] = val 533 534 # meta 535 # ---- 536 @property 537 def meta(self): 538 """ 539 Assigns extra meta information associated with this trace that 540 can be used in various text attributes. Attributes such as 541 trace `name`, graph, axis and colorbar `title.text`, annotation 542 `text` `rangeselector`, `updatemenues` and `sliders` `label` 543 text all support `meta`. To access the trace `meta` values in 544 an attribute in the same trace, simply use `%{meta[i]}` where 545 `i` is the index or key of the `meta` item in question. To 546 access trace `meta` in layout attributes, use 547 `%{data[n[.meta[i]}` where `i` is the index or key of the 548 `meta` and `n` is the trace index. 549 550 The 'meta' property accepts values of any type 551 552 Returns 553 ------- 554 Any|numpy.ndarray 555 """ 556 return self["meta"] 557 558 @meta.setter 559 def meta(self, val): 560 self["meta"] = val 561 562 # metasrc 563 # ------- 564 @property 565 def metasrc(self): 566 """ 567 Sets the source reference on Chart Studio Cloud for meta . 568 569 The 'metasrc' property must be specified as a string or 570 as a plotly.grid_objs.Column object 571 572 Returns 573 ------- 574 str 575 """ 576 return self["metasrc"] 577 578 @metasrc.setter 579 def metasrc(self, val): 580 self["metasrc"] = val 581 582 # name 583 # ---- 584 @property 585 def name(self): 586 """ 587 Sets the trace name. The trace name appear as the legend item 588 and on hover. 589 590 The 'name' property is a string and must be specified as: 591 - A string 592 - A number that will be converted to a string 593 594 Returns 595 ------- 596 str 597 """ 598 return self["name"] 599 600 @name.setter 601 def name(self, val): 602 self["name"] = val 603 604 # opacity 605 # ------- 606 @property 607 def opacity(self): 608 """ 609 Sets the opacity of the trace. 610 611 The 'opacity' property is a number and may be specified as: 612 - An int or float in the interval [0, 1] 613 614 Returns 615 ------- 616 int|float 617 """ 618 return self["opacity"] 619 620 @opacity.setter 621 def opacity(self, val): 622 self["opacity"] = val 623 624 # open 625 # ---- 626 @property 627 def open(self): 628 """ 629 Sets the open values. 630 631 The 'open' property is an array that may be specified as a tuple, 632 list, numpy array, or pandas Series 633 634 Returns 635 ------- 636 numpy.ndarray 637 """ 638 return self["open"] 639 640 @open.setter 641 def open(self, val): 642 self["open"] = val 643 644 # opensrc 645 # ------- 646 @property 647 def opensrc(self): 648 """ 649 Sets the source reference on Chart Studio Cloud for open . 650 651 The 'opensrc' property must be specified as a string or 652 as a plotly.grid_objs.Column object 653 654 Returns 655 ------- 656 str 657 """ 658 return self["opensrc"] 659 660 @opensrc.setter 661 def opensrc(self, val): 662 self["opensrc"] = val 663 664 # selectedpoints 665 # -------------- 666 @property 667 def selectedpoints(self): 668 """ 669 Array containing integer indices of selected points. Has an 670 effect only for traces that support selections. Note that an 671 empty array means an empty selection where the `unselected` are 672 turned on for all points, whereas, any other non-array values 673 means no selection all where the `selected` and `unselected` 674 styles have no effect. 675 676 The 'selectedpoints' property accepts values of any type 677 678 Returns 679 ------- 680 Any 681 """ 682 return self["selectedpoints"] 683 684 @selectedpoints.setter 685 def selectedpoints(self, val): 686 self["selectedpoints"] = val 687 688 # showlegend 689 # ---------- 690 @property 691 def showlegend(self): 692 """ 693 Determines whether or not an item corresponding to this trace 694 is shown in the legend. 695 696 The 'showlegend' property must be specified as a bool 697 (either True, or False) 698 699 Returns 700 ------- 701 bool 702 """ 703 return self["showlegend"] 704 705 @showlegend.setter 706 def showlegend(self, val): 707 self["showlegend"] = val 708 709 # stream 710 # ------ 711 @property 712 def stream(self): 713 """ 714 The 'stream' property is an instance of Stream 715 that may be specified as: 716 - An instance of :class:`plotly.graph_objs.candlestick.Stream` 717 - A dict of string/value properties that will be passed 718 to the Stream constructor 719 720 Supported dict properties: 721 722 maxpoints 723 Sets the maximum number of points to keep on 724 the plots from an incoming stream. If 725 `maxpoints` is set to 50, only the newest 50 726 points will be displayed on the plot. 727 token 728 The stream id number links a data trace on a 729 plot with a stream. See https://chart- 730 studio.plotly.com/settings for more details. 731 732 Returns 733 ------- 734 plotly.graph_objs.candlestick.Stream 735 """ 736 return self["stream"] 737 738 @stream.setter 739 def stream(self, val): 740 self["stream"] = val 741 742 # text 743 # ---- 744 @property 745 def text(self): 746 """ 747 Sets hover text elements associated with each sample point. If 748 a single string, the same string appears over all the data 749 points. If an array of string, the items are mapped in order to 750 this trace's sample points. 751 752 The 'text' property is a string and must be specified as: 753 - A string 754 - A number that will be converted to a string 755 - A tuple, list, or one-dimensional numpy array of the above 756 757 Returns 758 ------- 759 str|numpy.ndarray 760 """ 761 return self["text"] 762 763 @text.setter 764 def text(self, val): 765 self["text"] = val 766 767 # textsrc 768 # ------- 769 @property 770 def textsrc(self): 771 """ 772 Sets the source reference on Chart Studio Cloud for text . 773 774 The 'textsrc' property must be specified as a string or 775 as a plotly.grid_objs.Column object 776 777 Returns 778 ------- 779 str 780 """ 781 return self["textsrc"] 782 783 @textsrc.setter 784 def textsrc(self, val): 785 self["textsrc"] = val 786 787 # uid 788 # --- 789 @property 790 def uid(self): 791 """ 792 Assign an id to this trace, Use this to provide object 793 constancy between traces during animations and transitions. 794 795 The 'uid' property is a string and must be specified as: 796 - A string 797 - A number that will be converted to a string 798 799 Returns 800 ------- 801 str 802 """ 803 return self["uid"] 804 805 @uid.setter 806 def uid(self, val): 807 self["uid"] = val 808 809 # uirevision 810 # ---------- 811 @property 812 def uirevision(self): 813 """ 814 Controls persistence of some user-driven changes to the trace: 815 `constraintrange` in `parcoords` traces, as well as some 816 `editable: true` modifications such as `name` and 817 `colorbar.title`. Defaults to `layout.uirevision`. Note that 818 other user-driven trace attribute changes are controlled by 819 `layout` attributes: `trace.visible` is controlled by 820 `layout.legend.uirevision`, `selectedpoints` is controlled by 821 `layout.selectionrevision`, and `colorbar.(x|y)` (accessible 822 with `config: {editable: true}`) is controlled by 823 `layout.editrevision`. Trace changes are tracked by `uid`, 824 which only falls back on trace index if no `uid` is provided. 825 So if your app can add/remove traces before the end of the 826 `data` array, such that the same trace has a different index, 827 you can still preserve user-driven changes if you give each 828 trace a `uid` that stays with it as it moves. 829 830 The 'uirevision' property accepts values of any type 831 832 Returns 833 ------- 834 Any 835 """ 836 return self["uirevision"] 837 838 @uirevision.setter 839 def uirevision(self, val): 840 self["uirevision"] = val 841 842 # visible 843 # ------- 844 @property 845 def visible(self): 846 """ 847 Determines whether or not this trace is visible. If 848 "legendonly", the trace is not drawn, but can appear as a 849 legend item (provided that the legend itself is visible). 850 851 The 'visible' property is an enumeration that may be specified as: 852 - One of the following enumeration values: 853 [True, False, 'legendonly'] 854 855 Returns 856 ------- 857 Any 858 """ 859 return self["visible"] 860 861 @visible.setter 862 def visible(self, val): 863 self["visible"] = val 864 865 # whiskerwidth 866 # ------------ 867 @property 868 def whiskerwidth(self): 869 """ 870 Sets the width of the whiskers relative to the box' width. For 871 example, with 1, the whiskers are as wide as the box(es). 872 873 The 'whiskerwidth' property is a number and may be specified as: 874 - An int or float in the interval [0, 1] 875 876 Returns 877 ------- 878 int|float 879 """ 880 return self["whiskerwidth"] 881 882 @whiskerwidth.setter 883 def whiskerwidth(self, val): 884 self["whiskerwidth"] = val 885 886 # x 887 # - 888 @property 889 def x(self): 890 """ 891 Sets the x coordinates. If absent, linear coordinate will be 892 generated. 893 894 The 'x' property is an array that may be specified as a tuple, 895 list, numpy array, or pandas Series 896 897 Returns 898 ------- 899 numpy.ndarray 900 """ 901 return self["x"] 902 903 @x.setter 904 def x(self, val): 905 self["x"] = val 906 907 # xaxis 908 # ----- 909 @property 910 def xaxis(self): 911 """ 912 Sets a reference between this trace's x coordinates and a 2D 913 cartesian x axis. If "x" (the default value), the x coordinates 914 refer to `layout.xaxis`. If "x2", the x coordinates refer to 915 `layout.xaxis2`, and so on. 916 917 The 'xaxis' property is an identifier of a particular 918 subplot, of type 'x', that may be specified as the string 'x' 919 optionally followed by an integer >= 1 920 (e.g. 'x', 'x1', 'x2', 'x3', etc.) 921 922 Returns 923 ------- 924 str 925 """ 926 return self["xaxis"] 927 928 @xaxis.setter 929 def xaxis(self, val): 930 self["xaxis"] = val 931 932 # xcalendar 933 # --------- 934 @property 935 def xcalendar(self): 936 """ 937 Sets the calendar system to use with `x` date data. 938 939 The 'xcalendar' property is an enumeration that may be specified as: 940 - One of the following enumeration values: 941 ['gregorian', 'chinese', 'coptic', 'discworld', 942 'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan', 943 'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan', 944 'thai', 'ummalqura'] 945 946 Returns 947 ------- 948 Any 949 """ 950 return self["xcalendar"] 951 952 @xcalendar.setter 953 def xcalendar(self, val): 954 self["xcalendar"] = val 955 956 # xperiod 957 # ------- 958 @property 959 def xperiod(self): 960 """ 961 Only relevant when the axis `type` is "date". Sets the period 962 positioning in milliseconds or "M<n>" on the x axis. Special 963 values in the form of "M<n>" could be used to declare the 964 number of months. In this case `n` must be a positive integer. 965 966 The 'xperiod' property accepts values of any type 967 968 Returns 969 ------- 970 Any 971 """ 972 return self["xperiod"] 973 974 @xperiod.setter 975 def xperiod(self, val): 976 self["xperiod"] = val 977 978 # xperiod0 979 # -------- 980 @property 981 def xperiod0(self): 982 """ 983 Only relevant when the axis `type` is "date". Sets the base for 984 period positioning in milliseconds or date string on the x0 985 axis. When `x0period` is round number of weeks, the `x0period0` 986 by default would be on a Sunday i.e. 2000-01-02, otherwise it 987 would be at 2000-01-01. 988 989 The 'xperiod0' property accepts values of any type 990 991 Returns 992 ------- 993 Any 994 """ 995 return self["xperiod0"] 996 997 @xperiod0.setter 998 def xperiod0(self, val): 999 self["xperiod0"] = val 1000 1001 # xperiodalignment 1002 # ---------------- 1003 @property 1004 def xperiodalignment(self): 1005 """ 1006 Only relevant when the axis `type` is "date". Sets the 1007 alignment of data points on the x axis. 1008 1009 The 'xperiodalignment' property is an enumeration that may be specified as: 1010 - One of the following enumeration values: 1011 ['start', 'middle', 'end'] 1012 1013 Returns 1014 ------- 1015 Any 1016 """ 1017 return self["xperiodalignment"] 1018 1019 @xperiodalignment.setter 1020 def xperiodalignment(self, val): 1021 self["xperiodalignment"] = val 1022 1023 # xsrc 1024 # ---- 1025 @property 1026 def xsrc(self): 1027 """ 1028 Sets the source reference on Chart Studio Cloud for x . 1029 1030 The 'xsrc' property must be specified as a string or 1031 as a plotly.grid_objs.Column object 1032 1033 Returns 1034 ------- 1035 str 1036 """ 1037 return self["xsrc"] 1038 1039 @xsrc.setter 1040 def xsrc(self, val): 1041 self["xsrc"] = val 1042 1043 # yaxis 1044 # ----- 1045 @property 1046 def yaxis(self): 1047 """ 1048 Sets a reference between this trace's y coordinates and a 2D 1049 cartesian y axis. If "y" (the default value), the y coordinates 1050 refer to `layout.yaxis`. If "y2", the y coordinates refer to 1051 `layout.yaxis2`, and so on. 1052 1053 The 'yaxis' property is an identifier of a particular 1054 subplot, of type 'y', that may be specified as the string 'y' 1055 optionally followed by an integer >= 1 1056 (e.g. 'y', 'y1', 'y2', 'y3', etc.) 1057 1058 Returns 1059 ------- 1060 str 1061 """ 1062 return self["yaxis"] 1063 1064 @yaxis.setter 1065 def yaxis(self, val): 1066 self["yaxis"] = val 1067 1068 # type 1069 # ---- 1070 @property 1071 def type(self): 1072 return self._props["type"] 1073 1074 # Self properties description 1075 # --------------------------- 1076 @property 1077 def _prop_descriptions(self): 1078 return """\ 1079 close 1080 Sets the close values. 1081 closesrc 1082 Sets the source reference on Chart Studio Cloud for 1083 close . 1084 customdata 1085 Assigns extra data each datum. This may be useful when 1086 listening to hover, click and selection events. Note 1087 that, "scatter" traces also appends customdata items in 1088 the markers DOM elements 1089 customdatasrc 1090 Sets the source reference on Chart Studio Cloud for 1091 customdata . 1092 decreasing 1093 :class:`plotly.graph_objects.candlestick.Decreasing` 1094 instance or dict with compatible properties 1095 high 1096 Sets the high values. 1097 highsrc 1098 Sets the source reference on Chart Studio Cloud for 1099 high . 1100 hoverinfo 1101 Determines which trace information appear on hover. If 1102 `none` or `skip` are set, no information is displayed 1103 upon hovering. But, if `none` is set, click and hover 1104 events are still fired. 1105 hoverinfosrc 1106 Sets the source reference on Chart Studio Cloud for 1107 hoverinfo . 1108 hoverlabel 1109 :class:`plotly.graph_objects.candlestick.Hoverlabel` 1110 instance or dict with compatible properties 1111 hovertext 1112 Same as `text`. 1113 hovertextsrc 1114 Sets the source reference on Chart Studio Cloud for 1115 hovertext . 1116 ids 1117 Assigns id labels to each datum. These ids for object 1118 constancy of data points during animation. Should be an 1119 array of strings, not numbers or any other type. 1120 idssrc 1121 Sets the source reference on Chart Studio Cloud for 1122 ids . 1123 increasing 1124 :class:`plotly.graph_objects.candlestick.Increasing` 1125 instance or dict with compatible properties 1126 legendgroup 1127 Sets the legend group for this trace. Traces part of 1128 the same legend group hide/show at the same time when 1129 toggling legend items. 1130 line 1131 :class:`plotly.graph_objects.candlestick.Line` instance 1132 or dict with compatible properties 1133 low 1134 Sets the low values. 1135 lowsrc 1136 Sets the source reference on Chart Studio Cloud for 1137 low . 1138 meta 1139 Assigns extra meta information associated with this 1140 trace that can be used in various text attributes. 1141 Attributes such as trace `name`, graph, axis and 1142 colorbar `title.text`, annotation `text` 1143 `rangeselector`, `updatemenues` and `sliders` `label` 1144 text all support `meta`. To access the trace `meta` 1145 values in an attribute in the same trace, simply use 1146 `%{meta[i]}` where `i` is the index or key of the 1147 `meta` item in question. To access trace `meta` in 1148 layout attributes, use `%{data[n[.meta[i]}` where `i` 1149 is the index or key of the `meta` and `n` is the trace 1150 index. 1151 metasrc 1152 Sets the source reference on Chart Studio Cloud for 1153 meta . 1154 name 1155 Sets the trace name. The trace name appear as the 1156 legend item and on hover. 1157 opacity 1158 Sets the opacity of the trace. 1159 open 1160 Sets the open values. 1161 opensrc 1162 Sets the source reference on Chart Studio Cloud for 1163 open . 1164 selectedpoints 1165 Array containing integer indices of selected points. 1166 Has an effect only for traces that support selections. 1167 Note that an empty array means an empty selection where 1168 the `unselected` are turned on for all points, whereas, 1169 any other non-array values means no selection all where 1170 the `selected` and `unselected` styles have no effect. 1171 showlegend 1172 Determines whether or not an item corresponding to this 1173 trace is shown in the legend. 1174 stream 1175 :class:`plotly.graph_objects.candlestick.Stream` 1176 instance or dict with compatible properties 1177 text 1178 Sets hover text elements associated with each sample 1179 point. If a single string, the same string appears over 1180 all the data points. If an array of string, the items 1181 are mapped in order to this trace's sample points. 1182 textsrc 1183 Sets the source reference on Chart Studio Cloud for 1184 text . 1185 uid 1186 Assign an id to this trace, Use this to provide object 1187 constancy between traces during animations and 1188 transitions. 1189 uirevision 1190 Controls persistence of some user-driven changes to the 1191 trace: `constraintrange` in `parcoords` traces, as well 1192 as some `editable: true` modifications such as `name` 1193 and `colorbar.title`. Defaults to `layout.uirevision`. 1194 Note that other user-driven trace attribute changes are 1195 controlled by `layout` attributes: `trace.visible` is 1196 controlled by `layout.legend.uirevision`, 1197 `selectedpoints` is controlled by 1198 `layout.selectionrevision`, and `colorbar.(x|y)` 1199 (accessible with `config: {editable: true}`) is 1200 controlled by `layout.editrevision`. Trace changes are 1201 tracked by `uid`, which only falls back on trace index 1202 if no `uid` is provided. So if your app can add/remove 1203 traces before the end of the `data` array, such that 1204 the same trace has a different index, you can still 1205 preserve user-driven changes if you give each trace a 1206 `uid` that stays with it as it moves. 1207 visible 1208 Determines whether or not this trace is visible. If 1209 "legendonly", the trace is not drawn, but can appear as 1210 a legend item (provided that the legend itself is 1211 visible). 1212 whiskerwidth 1213 Sets the width of the whiskers relative to the box' 1214 width. For example, with 1, the whiskers are as wide as 1215 the box(es). 1216 x 1217 Sets the x coordinates. If absent, linear coordinate 1218 will be generated. 1219 xaxis 1220 Sets a reference between this trace's x coordinates and 1221 a 2D cartesian x axis. If "x" (the default value), the 1222 x coordinates refer to `layout.xaxis`. If "x2", the x 1223 coordinates refer to `layout.xaxis2`, and so on. 1224 xcalendar 1225 Sets the calendar system to use with `x` date data. 1226 xperiod 1227 Only relevant when the axis `type` is "date". Sets the 1228 period positioning in milliseconds or "M<n>" on the x 1229 axis. Special values in the form of "M<n>" could be 1230 used to declare the number of months. In this case `n` 1231 must be a positive integer. 1232 xperiod0 1233 Only relevant when the axis `type` is "date". Sets the 1234 base for period positioning in milliseconds or date 1235 string on the x0 axis. When `x0period` is round number 1236 of weeks, the `x0period0` by default would be on a 1237 Sunday i.e. 2000-01-02, otherwise it would be at 1238 2000-01-01. 1239 xperiodalignment 1240 Only relevant when the axis `type` is "date". Sets the 1241 alignment of data points on the x axis. 1242 xsrc 1243 Sets the source reference on Chart Studio Cloud for x 1244 . 1245 yaxis 1246 Sets a reference between this trace's y coordinates and 1247 a 2D cartesian y axis. If "y" (the default value), the 1248 y coordinates refer to `layout.yaxis`. If "y2", the y 1249 coordinates refer to `layout.yaxis2`, and so on. 1250 """ 1251 1252 def __init__( 1253 self, 1254 arg=None, 1255 close=None, 1256 closesrc=None, 1257 customdata=None, 1258 customdatasrc=None, 1259 decreasing=None, 1260 high=None, 1261 highsrc=None, 1262 hoverinfo=None, 1263 hoverinfosrc=None, 1264 hoverlabel=None, 1265 hovertext=None, 1266 hovertextsrc=None, 1267 ids=None, 1268 idssrc=None, 1269 increasing=None, 1270 legendgroup=None, 1271 line=None, 1272 low=None, 1273 lowsrc=None, 1274 meta=None, 1275 metasrc=None, 1276 name=None, 1277 opacity=None, 1278 open=None, 1279 opensrc=None, 1280 selectedpoints=None, 1281 showlegend=None, 1282 stream=None, 1283 text=None, 1284 textsrc=None, 1285 uid=None, 1286 uirevision=None, 1287 visible=None, 1288 whiskerwidth=None, 1289 x=None, 1290 xaxis=None, 1291 xcalendar=None, 1292 xperiod=None, 1293 xperiod0=None, 1294 xperiodalignment=None, 1295 xsrc=None, 1296 yaxis=None, 1297 **kwargs 1298 ): 1299 """ 1300 Construct a new Candlestick object 1301 1302 The candlestick is a style of financial chart describing open, 1303 high, low and close for a given `x` coordinate (most likely 1304 time). The boxes represent the spread between the `open` and 1305 `close` values and the lines represent the spread between the 1306 `low` and `high` values Sample points where the close value is 1307 higher (lower) then the open value are called increasing 1308 (decreasing). By default, increasing candles are drawn in green 1309 whereas decreasing are drawn in red. 1310 1311 Parameters 1312 ---------- 1313 arg 1314 dict of properties compatible with this constructor or 1315 an instance of :class:`plotly.graph_objs.Candlestick` 1316 close 1317 Sets the close values. 1318 closesrc 1319 Sets the source reference on Chart Studio Cloud for 1320 close . 1321 customdata 1322 Assigns extra data each datum. This may be useful when 1323 listening to hover, click and selection events. Note 1324 that, "scatter" traces also appends customdata items in 1325 the markers DOM elements 1326 customdatasrc 1327 Sets the source reference on Chart Studio Cloud for 1328 customdata . 1329 decreasing 1330 :class:`plotly.graph_objects.candlestick.Decreasing` 1331 instance or dict with compatible properties 1332 high 1333 Sets the high values. 1334 highsrc 1335 Sets the source reference on Chart Studio Cloud for 1336 high . 1337 hoverinfo 1338 Determines which trace information appear on hover. If 1339 `none` or `skip` are set, no information is displayed 1340 upon hovering. But, if `none` is set, click and hover 1341 events are still fired. 1342 hoverinfosrc 1343 Sets the source reference on Chart Studio Cloud for 1344 hoverinfo . 1345 hoverlabel 1346 :class:`plotly.graph_objects.candlestick.Hoverlabel` 1347 instance or dict with compatible properties 1348 hovertext 1349 Same as `text`. 1350 hovertextsrc 1351 Sets the source reference on Chart Studio Cloud for 1352 hovertext . 1353 ids 1354 Assigns id labels to each datum. These ids for object 1355 constancy of data points during animation. Should be an 1356 array of strings, not numbers or any other type. 1357 idssrc 1358 Sets the source reference on Chart Studio Cloud for 1359 ids . 1360 increasing 1361 :class:`plotly.graph_objects.candlestick.Increasing` 1362 instance or dict with compatible properties 1363 legendgroup 1364 Sets the legend group for this trace. Traces part of 1365 the same legend group hide/show at the same time when 1366 toggling legend items. 1367 line 1368 :class:`plotly.graph_objects.candlestick.Line` instance 1369 or dict with compatible properties 1370 low 1371 Sets the low values. 1372 lowsrc 1373 Sets the source reference on Chart Studio Cloud for 1374 low . 1375 meta 1376 Assigns extra meta information associated with this 1377 trace that can be used in various text attributes. 1378 Attributes such as trace `name`, graph, axis and 1379 colorbar `title.text`, annotation `text` 1380 `rangeselector`, `updatemenues` and `sliders` `label` 1381 text all support `meta`. To access the trace `meta` 1382 values in an attribute in the same trace, simply use 1383 `%{meta[i]}` where `i` is the index or key of the 1384 `meta` item in question. To access trace `meta` in 1385 layout attributes, use `%{data[n[.meta[i]}` where `i` 1386 is the index or key of the `meta` and `n` is the trace 1387 index. 1388 metasrc 1389 Sets the source reference on Chart Studio Cloud for 1390 meta . 1391 name 1392 Sets the trace name. The trace name appear as the 1393 legend item and on hover. 1394 opacity 1395 Sets the opacity of the trace. 1396 open 1397 Sets the open values. 1398 opensrc 1399 Sets the source reference on Chart Studio Cloud for 1400 open . 1401 selectedpoints 1402 Array containing integer indices of selected points. 1403 Has an effect only for traces that support selections. 1404 Note that an empty array means an empty selection where 1405 the `unselected` are turned on for all points, whereas, 1406 any other non-array values means no selection all where 1407 the `selected` and `unselected` styles have no effect. 1408 showlegend 1409 Determines whether or not an item corresponding to this 1410 trace is shown in the legend. 1411 stream 1412 :class:`plotly.graph_objects.candlestick.Stream` 1413 instance or dict with compatible properties 1414 text 1415 Sets hover text elements associated with each sample 1416 point. If a single string, the same string appears over 1417 all the data points. If an array of string, the items 1418 are mapped in order to this trace's sample points. 1419 textsrc 1420 Sets the source reference on Chart Studio Cloud for 1421 text . 1422 uid 1423 Assign an id to this trace, Use this to provide object 1424 constancy between traces during animations and 1425 transitions. 1426 uirevision 1427 Controls persistence of some user-driven changes to the 1428 trace: `constraintrange` in `parcoords` traces, as well 1429 as some `editable: true` modifications such as `name` 1430 and `colorbar.title`. Defaults to `layout.uirevision`. 1431 Note that other user-driven trace attribute changes are 1432 controlled by `layout` attributes: `trace.visible` is 1433 controlled by `layout.legend.uirevision`, 1434 `selectedpoints` is controlled by 1435 `layout.selectionrevision`, and `colorbar.(x|y)` 1436 (accessible with `config: {editable: true}`) is 1437 controlled by `layout.editrevision`. Trace changes are 1438 tracked by `uid`, which only falls back on trace index 1439 if no `uid` is provided. So if your app can add/remove 1440 traces before the end of the `data` array, such that 1441 the same trace has a different index, you can still 1442 preserve user-driven changes if you give each trace a 1443 `uid` that stays with it as it moves. 1444 visible 1445 Determines whether or not this trace is visible. If 1446 "legendonly", the trace is not drawn, but can appear as 1447 a legend item (provided that the legend itself is 1448 visible). 1449 whiskerwidth 1450 Sets the width of the whiskers relative to the box' 1451 width. For example, with 1, the whiskers are as wide as 1452 the box(es). 1453 x 1454 Sets the x coordinates. If absent, linear coordinate 1455 will be generated. 1456 xaxis 1457 Sets a reference between this trace's x coordinates and 1458 a 2D cartesian x axis. If "x" (the default value), the 1459 x coordinates refer to `layout.xaxis`. If "x2", the x 1460 coordinates refer to `layout.xaxis2`, and so on. 1461 xcalendar 1462 Sets the calendar system to use with `x` date data. 1463 xperiod 1464 Only relevant when the axis `type` is "date". Sets the 1465 period positioning in milliseconds or "M<n>" on the x 1466 axis. Special values in the form of "M<n>" could be 1467 used to declare the number of months. In this case `n` 1468 must be a positive integer. 1469 xperiod0 1470 Only relevant when the axis `type` is "date". Sets the 1471 base for period positioning in milliseconds or date 1472 string on the x0 axis. When `x0period` is round number 1473 of weeks, the `x0period0` by default would be on a 1474 Sunday i.e. 2000-01-02, otherwise it would be at 1475 2000-01-01. 1476 xperiodalignment 1477 Only relevant when the axis `type` is "date". Sets the 1478 alignment of data points on the x axis. 1479 xsrc 1480 Sets the source reference on Chart Studio Cloud for x 1481 . 1482 yaxis 1483 Sets a reference between this trace's y coordinates and 1484 a 2D cartesian y axis. If "y" (the default value), the 1485 y coordinates refer to `layout.yaxis`. If "y2", the y 1486 coordinates refer to `layout.yaxis2`, and so on. 1487 1488 Returns 1489 ------- 1490 Candlestick 1491 """ 1492 super(Candlestick, self).__init__("candlestick") 1493 1494 if "_parent" in kwargs: 1495 self._parent = kwargs["_parent"] 1496 return 1497 1498 # Validate arg 1499 # ------------ 1500 if arg is None: 1501 arg = {} 1502 elif isinstance(arg, self.__class__): 1503 arg = arg.to_plotly_json() 1504 elif isinstance(arg, dict): 1505 arg = _copy.copy(arg) 1506 else: 1507 raise ValueError( 1508 """\ 1509The first argument to the plotly.graph_objs.Candlestick 1510constructor must be a dict or 1511an instance of :class:`plotly.graph_objs.Candlestick`""" 1512 ) 1513 1514 # Handle skip_invalid 1515 # ------------------- 1516 self._skip_invalid = kwargs.pop("skip_invalid", False) 1517 self._validate = kwargs.pop("_validate", True) 1518 1519 # Populate data dict with properties 1520 # ---------------------------------- 1521 _v = arg.pop("close", None) 1522 _v = close if close is not None else _v 1523 if _v is not None: 1524 self["close"] = _v 1525 _v = arg.pop("closesrc", None) 1526 _v = closesrc if closesrc is not None else _v 1527 if _v is not None: 1528 self["closesrc"] = _v 1529 _v = arg.pop("customdata", None) 1530 _v = customdata if customdata is not None else _v 1531 if _v is not None: 1532 self["customdata"] = _v 1533 _v = arg.pop("customdatasrc", None) 1534 _v = customdatasrc if customdatasrc is not None else _v 1535 if _v is not None: 1536 self["customdatasrc"] = _v 1537 _v = arg.pop("decreasing", None) 1538 _v = decreasing if decreasing is not None else _v 1539 if _v is not None: 1540 self["decreasing"] = _v 1541 _v = arg.pop("high", None) 1542 _v = high if high is not None else _v 1543 if _v is not None: 1544 self["high"] = _v 1545 _v = arg.pop("highsrc", None) 1546 _v = highsrc if highsrc is not None else _v 1547 if _v is not None: 1548 self["highsrc"] = _v 1549 _v = arg.pop("hoverinfo", None) 1550 _v = hoverinfo if hoverinfo is not None else _v 1551 if _v is not None: 1552 self["hoverinfo"] = _v 1553 _v = arg.pop("hoverinfosrc", None) 1554 _v = hoverinfosrc if hoverinfosrc is not None else _v 1555 if _v is not None: 1556 self["hoverinfosrc"] = _v 1557 _v = arg.pop("hoverlabel", None) 1558 _v = hoverlabel if hoverlabel is not None else _v 1559 if _v is not None: 1560 self["hoverlabel"] = _v 1561 _v = arg.pop("hovertext", None) 1562 _v = hovertext if hovertext is not None else _v 1563 if _v is not None: 1564 self["hovertext"] = _v 1565 _v = arg.pop("hovertextsrc", None) 1566 _v = hovertextsrc if hovertextsrc is not None else _v 1567 if _v is not None: 1568 self["hovertextsrc"] = _v 1569 _v = arg.pop("ids", None) 1570 _v = ids if ids is not None else _v 1571 if _v is not None: 1572 self["ids"] = _v 1573 _v = arg.pop("idssrc", None) 1574 _v = idssrc if idssrc is not None else _v 1575 if _v is not None: 1576 self["idssrc"] = _v 1577 _v = arg.pop("increasing", None) 1578 _v = increasing if increasing is not None else _v 1579 if _v is not None: 1580 self["increasing"] = _v 1581 _v = arg.pop("legendgroup", None) 1582 _v = legendgroup if legendgroup is not None else _v 1583 if _v is not None: 1584 self["legendgroup"] = _v 1585 _v = arg.pop("line", None) 1586 _v = line if line is not None else _v 1587 if _v is not None: 1588 self["line"] = _v 1589 _v = arg.pop("low", None) 1590 _v = low if low is not None else _v 1591 if _v is not None: 1592 self["low"] = _v 1593 _v = arg.pop("lowsrc", None) 1594 _v = lowsrc if lowsrc is not None else _v 1595 if _v is not None: 1596 self["lowsrc"] = _v 1597 _v = arg.pop("meta", None) 1598 _v = meta if meta is not None else _v 1599 if _v is not None: 1600 self["meta"] = _v 1601 _v = arg.pop("metasrc", None) 1602 _v = metasrc if metasrc is not None else _v 1603 if _v is not None: 1604 self["metasrc"] = _v 1605 _v = arg.pop("name", None) 1606 _v = name if name is not None else _v 1607 if _v is not None: 1608 self["name"] = _v 1609 _v = arg.pop("opacity", None) 1610 _v = opacity if opacity is not None else _v 1611 if _v is not None: 1612 self["opacity"] = _v 1613 _v = arg.pop("open", None) 1614 _v = open if open is not None else _v 1615 if _v is not None: 1616 self["open"] = _v 1617 _v = arg.pop("opensrc", None) 1618 _v = opensrc if opensrc is not None else _v 1619 if _v is not None: 1620 self["opensrc"] = _v 1621 _v = arg.pop("selectedpoints", None) 1622 _v = selectedpoints if selectedpoints is not None else _v 1623 if _v is not None: 1624 self["selectedpoints"] = _v 1625 _v = arg.pop("showlegend", None) 1626 _v = showlegend if showlegend is not None else _v 1627 if _v is not None: 1628 self["showlegend"] = _v 1629 _v = arg.pop("stream", None) 1630 _v = stream if stream is not None else _v 1631 if _v is not None: 1632 self["stream"] = _v 1633 _v = arg.pop("text", None) 1634 _v = text if text is not None else _v 1635 if _v is not None: 1636 self["text"] = _v 1637 _v = arg.pop("textsrc", None) 1638 _v = textsrc if textsrc is not None else _v 1639 if _v is not None: 1640 self["textsrc"] = _v 1641 _v = arg.pop("uid", None) 1642 _v = uid if uid is not None else _v 1643 if _v is not None: 1644 self["uid"] = _v 1645 _v = arg.pop("uirevision", None) 1646 _v = uirevision if uirevision is not None else _v 1647 if _v is not None: 1648 self["uirevision"] = _v 1649 _v = arg.pop("visible", None) 1650 _v = visible if visible is not None else _v 1651 if _v is not None: 1652 self["visible"] = _v 1653 _v = arg.pop("whiskerwidth", None) 1654 _v = whiskerwidth if whiskerwidth is not None else _v 1655 if _v is not None: 1656 self["whiskerwidth"] = _v 1657 _v = arg.pop("x", None) 1658 _v = x if x is not None else _v 1659 if _v is not None: 1660 self["x"] = _v 1661 _v = arg.pop("xaxis", None) 1662 _v = xaxis if xaxis is not None else _v 1663 if _v is not None: 1664 self["xaxis"] = _v 1665 _v = arg.pop("xcalendar", None) 1666 _v = xcalendar if xcalendar is not None else _v 1667 if _v is not None: 1668 self["xcalendar"] = _v 1669 _v = arg.pop("xperiod", None) 1670 _v = xperiod if xperiod is not None else _v 1671 if _v is not None: 1672 self["xperiod"] = _v 1673 _v = arg.pop("xperiod0", None) 1674 _v = xperiod0 if xperiod0 is not None else _v 1675 if _v is not None: 1676 self["xperiod0"] = _v 1677 _v = arg.pop("xperiodalignment", None) 1678 _v = xperiodalignment if xperiodalignment is not None else _v 1679 if _v is not None: 1680 self["xperiodalignment"] = _v 1681 _v = arg.pop("xsrc", None) 1682 _v = xsrc if xsrc is not None else _v 1683 if _v is not None: 1684 self["xsrc"] = _v 1685 _v = arg.pop("yaxis", None) 1686 _v = yaxis if yaxis is not None else _v 1687 if _v is not None: 1688 self["yaxis"] = _v 1689 1690 # Read-only literals 1691 # ------------------ 1692 1693 self._props["type"] = "candlestick" 1694 arg.pop("type", None) 1695 1696 # Process unknown kwargs 1697 # ---------------------- 1698 self._process_kwargs(**dict(arg, **kwargs)) 1699 1700 # Reset skip_invalid 1701 # ------------------ 1702 self._skip_invalid = False 1703