sassoftware / sas-visualanalytics-thirdpartyvisualizations

The data-driven content object enables you to display your data in a custom third-party visualization, within your SAS Visual Analytics report. The third-party visualization can be authored in any JavaScript charting framework, such as D3.js, Google Charts, or CanvasJS. The visualization in a data-driven content object receives its data query from SAS Visual Analytics, and so it interacts with filters, ranks, and object actions in the same way as the other objects in your report. For information about creating third-party visualizations for data-driven content, see Programming Considerations for Data-Driven Visualizations in SAS Visual Analytics: Reference.
Apache License 2.0
39 stars 61 forks source link

8_Variable_View_Stacked_Bar not working as expected #38

Closed flokwm closed 4 years ago

flokwm commented 4 years ago

d3 VariableViewStackedBar.docx

Hi, Please see attached doc on the behaviour that we observe in this variable view stacked bar. We'd like to know if this is a known issue and if there any workaround to this.

Thank you. Regards, Flo

rbwest commented 4 years ago

Hi Flo,

I wasn't able to exactly recreate your issue, but I did find an underlying problem with the chart if there is missing data in the first row that has been fixed. Please try the updated code and let me know if your issue is persisting. If it is, please update with detailed steps to replicate.

Thanks, Ryan

flokwm commented 4 years ago

Hi Ryan, Thanks for the updated code, have tried it however the issue persists. I have attached the detailed steps in the word document for your reference.

Thanks, Flo

d3 testing.docx

flokwm commented 4 years ago

Hi Ryan, Were you able to replicate this issue?

Thanks, Flo

rbwest commented 4 years ago

Hi Flo,

Sorry for the delay getting back to you. I was unable to replicate your issue, but I have a couple ideas from your document as to what the issue may be.

First, the brush column should not be an explicit column in your dataset. This column is generated by VA when you create a linked selection (not a filter) action from the button bar to the data-driven content object. In order to create the variable view stacked bar chart in your report you should:

  1. Create your sample dataset with columns: Y Category (year - string), Group By Category (txt_design_config - string), Measure (record - number), and View (view - string)
  2. Create the DDC Object in your report and assign the URL
  3. Create the button bar in your report and make it required
  4. Assign the role View (view - string) to the button bar
  5. Create a linked selection action from the button bar to the data-driven content object
  6. Assign the roles Y Category (year - string), Group By Category (txt_design_config - string), Measure (record - number), and View (view - string) to your data-driven content object

Second, I noticed that your Group By Category variable (txt_design_config) had parenthesis in it. I'm not sure if D3 will properly select elements with parenthesis in the ID tag because it uses CSS notation for selections. I would try removing the parenthesis and replacing them with hyphens or underscores if you are still having issues after following the steps above.

Thanks, Ryan

flokwm commented 4 years ago

Hi Ryan,

Thanks for your reply. Can I confirm if I was supposed to use the Stacked bar with or without the Brush variable? It seems to work without the Brush variable. d3 testing result.docx

rbwest commented 4 years ago

To confirm, you should not assign the brush column explicitly in VA. This column is instead created via the linked selection from the button bar. Since everything is working, I am going to close this issue now. Please reach out if you find any other issues.