NimaKL commited on
Commit
4f4f5c6
1 Parent(s): 0c43755

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -73,8 +73,9 @@ import streamlit.components.v1 as components
73
  html_string = '''
74
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
75
  <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.2.js"></script>
76
- <div style="width: 500px; height: 500px">
77
- <canvas id="myChart"></canvas>
 
78
  </div>
79
  <script type="text/javascript">
80
  var data = {
@@ -114,10 +115,8 @@ html_string = '''
114
 
115
  var label = chartData.labels[idx];
116
  var value = chartData.datasets[0].data[idx];
 
117
 
118
- var url = "http://example.com/?label=" + label + "&value=" + value;
119
- console.log(url);
120
- alert(url);
121
  }
122
  };
123
  }
@@ -125,9 +124,8 @@ html_string = '''
125
 
126
  </script>
127
  '''
128
- components.html(html_string)
129
 
130
- #st.components.v1.html()
131
  # description = '<table style="border: collapse; padding-top: 1px;"><tr><div style="height: 62px;"></div></tr><tr><p style="border-width: medium; border-color: #aa5e70; border-radius: 10px;padding-top: 1px;padding-left: 20px;background:#20212a;font-family:Courier New; color: white;font-size: 36px; font-weight: boldest;">'+result+'</p></tr><table>'
132
  # st.markdown(description, unsafe_allow_html=True)
133
 
 
73
  html_string = '''
74
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
75
  <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.2.js"></script>
76
+ <div style="width: 800px; height: 800px">
77
+ <h1 id="h1_id" style="color: white;">HELLO</h1>
78
+ <canvas id="myChart"></canvas>
79
  </div>
80
  <script type="text/javascript">
81
  var data = {
 
115
 
116
  var label = chartData.labels[idx];
117
  var value = chartData.datasets[0].data[idx];
118
+ document.getElementById('h1_id').innerHTML = chartData.labels[idx];
119
 
 
 
 
120
  }
121
  };
122
  }
 
124
 
125
  </script>
126
  '''
127
+ components.html(html_string, width=1000, height=1000)
128
 
 
129
  # description = '<table style="border: collapse; padding-top: 1px;"><tr><div style="height: 62px;"></div></tr><tr><p style="border-width: medium; border-color: #aa5e70; border-radius: 10px;padding-top: 1px;padding-left: 20px;background:#20212a;font-family:Courier New; color: white;font-size: 36px; font-weight: boldest;">'+result+'</p></tr><table>'
130
  # st.markdown(description, unsafe_allow_html=True)
131