Line Chart: lineDashStyle

Home Forums SPJS Charts for SharePoint Line Chart: lineDashStyle

Viewing 2 reply threads
  • Author
    Posts
    • #11767
      Chris Diltz
      Participant

        I have a line chart with a 4 lines/series and I’d like to have two of those lines appear dashed, and the other two appear solid. By default, all lines are solid.

        If I use the “lineDashStyle” option, it will obviously make all 4 lines dashed. I therefore assume the “series” option is the way to go, with the “lineDashStyle” option embedded within.

        Here’s how I set it up…

        Option: series
        variable text:
        {
        1: { lineDashStyle: [1, 1] },
        3: { lineDashStyle: [2, 2] }
        }

        Unfortunately, all of the lines are sticking to their default solid format.

        Anyone able to provide insight here?

      • #11805
        Alexander Bautz
        Keymaster

          Hi,
          Unfortunately the examples in Google’s examples does not have the correct JSON string syntax – use this format and you should get your dotted lines:

          Option name: “series”, option value:

          {
          	"0": {
          		"lineDashStyle": [
          			1,
          			1
          		]
          	},
          	"1": {
          		"lineDashStyle": [
          			2,
          			2
          		]
          	},
          	"2": {
          		"lineDashStyle": [
          			3,
          			3
          		]
          	}
          }

          Alexander

        • #11811
          Chris Diltz
          Participant

            Good catch, that fixed it. Thank you sir.

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.